/* Age & Gender Predictor Tool Styles */

/* Image Canvas Preview */
#imageCanvas {
    max-width: 100%;
    border: 2px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
    background: var(--bs-light-border-subtle);
}

/* Predictions Container */
#predictionsContainer {
    max-height: 600px;
    overflow-y: auto;
}

/* Prediction Cards */
.prediction-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    border: 1px solid #e0e0e0;
}

.prediction-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prediction-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.face-number-badge {
    background: #6c757d;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.face-title {
    color: #212529;
    font-weight: 600;
    font-size: 15px;
}

.prediction-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.prediction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.prediction-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.prediction-icon-wrapper {
    margin-bottom: 12px;
}

.prediction-icon-img {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.prediction-item:hover .prediction-icon-img {
    opacity: 0.9;
}

.prediction-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
    margin-bottom: 4px;
}

.prediction-label {
    font-size: 0.813rem;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}

/* Loading Status with Progress */
#loadingStatus {
    position: relative;
    overflow: hidden;
}

#loadingStatus::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-slide 1.5s infinite;
}

@keyframes loading-slide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #198754;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #0dcaf0;
}

.alert-danger {
    border-left-color: #dc3545;
}

[data-bs-theme="dark"] #imageCanvas {
    background: rgba(30, 34, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .prediction-card {
    background: #212529;
    border-color: #3d4349;
}

[data-bs-theme="dark"] .prediction-header {
    background: #2c3136;
    border-bottom-color: #3d4349;
}

[data-bs-theme="dark"] .face-title {
    color: #e9ecef;
}

[data-bs-theme="dark"] .face-number-badge {
    background: #495057;
}

[data-bs-theme="dark"] .prediction-item {
    background: #2c3136;
}

[data-bs-theme="dark"] .prediction-item:hover {
    background: #343a40;
}

[data-bs-theme="dark"] .prediction-value {
    color: #e9ecef;
}

/* Prevent text selection on labels */
.form-label {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.form-text {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

small.text-muted {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.card-header h6 {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Spinner enhancement */
.spinner-border {
    border-width: 3px;
}

/* Progress Bar for Model Loading */
.loading-progress {
    margin-top: 10px;
}

.loading-progress .progress {
    height: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress .progress-bar {
    background: linear-gradient(90deg, #052c65, #0a4b9e, #052c65);
    background-size: 200% 100%;
    animation: gradient-slide 1.5s ease infinite;
}

@keyframes gradient-slide {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

[data-bs-theme="dark"] .loading-progress .progress {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .loading-progress .progress-bar {
    background: linear-gradient(90deg, #a855f7, #c084fc, #a855f7);
    background-size: 200% 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    #imageCanvas {
        max-width: 100%;
    }
}

/* Icon colors */
.fsvg {
    transition: filter 0.2s ease;
}

/* Button hover effects - prevent filter on white icons */
.btn .filter-white {
    filter: brightness(0) invert(1);
}

.btn:hover .filter-white {
    filter: brightness(0) invert(1);
}

[data-bs-theme="dark"] .btn .filter-white {
    filter: brightness(0) invert(1);
}

[data-bs-theme="dark"] .btn:hover .filter-white {
    filter: brightness(0) invert(1);
}

/* Card animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prediction-card {
    animation: fadeIn 0.4s ease;
}

.prediction-card:nth-child(2) {
    animation-delay: 0.05s;
}

.prediction-card:nth-child(3) {
    animation-delay: 0.1s;
}

.prediction-card:nth-child(4) {
    animation-delay: 0.15s;
}

.prediction-card:nth-child(5) {
    animation-delay: 0.2s;
}

.prediction-card:nth-child(6) {
    animation-delay: 0.25s;
}

.prediction-card:nth-child(7) {
    animation-delay: 0.3s;
}

/* Responsive adjustments for predictions */
@media (max-width: 768px) {
    .prediction-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .prediction-value {
        font-size: 1.5rem;
    }

    .prediction-item {
        padding: 16px 12px;
    }

    #imageCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 576px) {

    .prediction-header {
        padding: 10px 14px;
    }

    .face-number-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .face-title {
        font-size: 14px;
    }

    .prediction-body {
        padding: 16px;
    }

    .prediction-icon-img {
        width: 30px;
        height: 30px;
    }
}
