/* ===== Score Prediction Page (توقّع درجتك) — v2 ===== */

/* Page Layout */
.predict-page {
    padding-top: 100px;
    min-height: 100vh;
}

/* Header */
.predict-header {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease;
}

.predict-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.predict-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Exam Selector Tabs ===== */
.exam-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 6px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.exam-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.exam-tab:hover {
    color: var(--text-primary);
    background: var(--bg-glass-light);
}

.exam-tab.active {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.exam-tab svg {
    flex-shrink: 0;
}

/* ===== Prediction Hero Card (Gauge) ===== */
.prediction-hero {
    animation: fadeInUp 0.5s ease 0.2s both;
}

.prediction-hero-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 48px 32px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.prediction-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: var(--gradient-card-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.prediction-hero-card .hero-bg-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.6s ease;
}

.hero-bg-glow.glow-green {
    background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
}

.hero-bg-glow.glow-yellow {
    background: radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.1) 0%, transparent 60%);
}

.hero-bg-glow.glow-red {
    background: radial-gradient(circle at 50% 30%, rgba(239, 68, 68, 0.1) 0%, transparent 60%);
}

/* ===== Circular Gauge ===== */
.gauge-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 28px;
}

.gauge-container svg {
    transform: rotate(-90deg);
    width: 240px;
    height: 240px;
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 14;
}

.gauge-fill {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px var(--gauge-glow, rgba(99, 102, 241, 0.3)));
}

.gauge-fill.green { stroke: url(#gaugeGradientGreen); --gauge-glow: rgba(99, 102, 241, 0.4); }
.gauge-fill.yellow { stroke: url(#gaugeGradientYellow); --gauge-glow: rgba(245, 158, 11, 0.4); }
.gauge-fill.red { stroke: url(#gaugeGradientRed); --gauge-glow: rgba(239, 68, 68, 0.4); }

.gauge-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-score {
    font-size: 3.8rem;
    font-weight: 900;
    line-height: 1.1;
    transition: color 0.4s ease;
}

.gauge-score.green {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gauge-score.yellow {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gauge-score.red {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gauge-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Confidence Badge */
.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.confidence-badge.high {
    background: rgba(99, 102, 241, 0.12);
    color: var(--success);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.confidence-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.confidence-badge.low {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.prediction-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.prediction-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.prediction-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.prediction-meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.prediction-meta-item strong {
    color: var(--text-primary);
}

/* ===== Score Band Section ===== */
.score-band-section {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.score-band-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 28px;
}

.score-band-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-band-track {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: var(--bg-tertiary);
    margin-bottom: 8px;
    overflow: visible;
}

.score-band-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    border-radius: 7px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-band-marker {
    position: absolute;
    top: 50%;
    transform: translate(50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--green-400, #6366F1);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
    transition: right 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.score-band-marker.green { border-color: #6366F1; box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4); }
.score-band-marker.yellow { border-color: #F59E0B; box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4); }
.score-band-marker.red { border-color: #EF4444; box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4); }

.score-bands-labels {
    display: flex;
    margin-top: 16px;
    gap: 4px;
}

.band-label {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.band-label.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.band-label.excellent {
    background: rgba(99, 102, 241, 0.1);
    color: var(--success);
}

.band-label.very-good {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.band-label.good {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.band-label.acceptable {
    background: rgba(249, 115, 22, 0.1);
    color: #F97316;
}

.band-label.needs-work {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ===== Section Breakdown Cards ===== */
.breakdown-section {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.breakdown-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.breakdown-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.breakdown-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-glow);
}

.breakdown-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    background: var(--bg-glass-light);
}

.breakdown-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.breakdown-card-score {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.breakdown-card-score.green {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breakdown-card-score.yellow {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breakdown-card-score.red {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breakdown-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-bar-fill.green { background: linear-gradient(90deg, #4F46E5, #6366F1); }
.breakdown-bar-fill.yellow { background: linear-gradient(90deg, #D97706, #F59E0B); }
.breakdown-bar-fill.red { background: linear-gradient(90deg, #DC2626, #EF4444); }

/* ===== Improvement Tips ===== */
.tips-section {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease 0.5s both;
}

.tips-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.tip-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-sm);
}

.tip-card.highlight {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.03));
}

.tip-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.4rem;
}

.tip-icon.warning { background: rgba(245, 158, 11, 0.12); }
.tip-icon.success { background: rgba(99, 102, 241, 0.12); }
.tip-icon.info { background: rgba(59, 130, 246, 0.12); }
.tip-icon.danger { background: rgba(239, 68, 68, 0.12); }

.tip-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.tip-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tip-impact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* ===== What-If Calculator ===== */
.whatif-section {
    animation: fadeInUp 0.5s ease 0.6s both;
}

.whatif-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 28px;
}

.whatif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.whatif-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatif-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-radius: 14px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.whatif-result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.whatif-result-score {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.whatif-result-delta {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.whatif-result-delta.positive {
    background: rgba(99, 102, 241, 0.12);
    color: var(--success);
}

.whatif-result-delta.negative {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.whatif-result-delta.neutral {
    background: var(--bg-glass-light);
    color: var(--text-secondary);
}

.whatif-sliders {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.whatif-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.whatif-slider-label {
    min-width: 90px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.whatif-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.whatif-slider:hover {
    background: var(--border-color);
}

.whatif-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s ease;
}

.whatif-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.whatif-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.whatif-slider-value {
    min-width: 52px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-color);
}

.whatif-reset {
    margin-top: 20px;
    text-align: center;
}

/* ===== Mini Gauge for What-If ===== */
.whatif-mini-gauge {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.whatif-mini-gauge svg {
    transform: rotate(-90deg);
}

/* ===== Empty State ===== */
.predict-empty {
    text-align: center;
    padding: 80px 20px;
    animation: fadeInUp 0.5s ease;
}

.predict-empty-icon {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--bg-glass-light);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 3.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.predict-empty h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.predict-empty p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 28px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.predict-empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Gauge Animation ===== */
@keyframes gaugeCountUp {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.gauge-animate {
    animation: gaugeCountUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Pulse ring around gauge ===== */
.gauge-pulse-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: gaugePulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

.gauge-pulse-ring.green { border-color: rgba(99, 102, 241, 0.2); }
.gauge-pulse-ring.yellow { border-color: rgba(245, 158, 11, 0.2); }
.gauge-pulse-ring.red { border-color: rgba(239, 68, 68, 0.2); }

@keyframes gaugePulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .predict-page {
        padding-top: 90px;
    }

    .exam-selector {
        flex-direction: column;
        gap: 4px;
    }

    .exam-tab {
        padding: 10px 16px;
    }

    .prediction-hero-card {
        padding: 36px 20px;
    }

    .gauge-container {
        width: 200px;
        height: 200px;
    }

    .gauge-container svg {
        width: 200px;
        height: 200px;
    }

    .gauge-score {
        font-size: 3rem;
    }

    .breakdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .whatif-slider-row {
        flex-wrap: wrap;
    }

    .whatif-slider-label {
        min-width: 100%;
        margin-bottom: -8px;
    }

    .whatif-header {
        flex-direction: column;
        text-align: center;
    }

    .score-bands-labels {
        flex-wrap: wrap;
        gap: 6px;
    }

    .band-label {
        min-width: calc(50% - 6px);
        flex: unset;
    }

    .prediction-meta {
        gap: 12px;
    }

    .tip-card {
        flex-direction: column;
        text-align: center;
    }

    .tip-icon {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .gauge-container {
        width: 170px;
        height: 170px;
    }

    .gauge-container svg {
        width: 170px;
        height: 170px;
    }

    .gauge-score {
        font-size: 2.5rem;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .predict-header h1 {
        font-size: 1.6rem;
    }

    .predict-empty-icon {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}
