@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

/* ═══════════════════════════════════════════════════════
   PRACTICE TOPICS PAGE — BFA Ground Class
   Responsive: Mobile / Tablet / Desktop
═══════════════════════════════════════════════════════ */

.practice-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f0f4ff;
    font-family: 'Outfit', sans-serif;
    isolation: auto;
}

/* ════════════════════════════════════════
   HEADER BANNER
════════════════════════════════════════ */
.practice-header {
    position: relative;
    padding: 32px 40px 28px;
    background: #ffffff;
    border-bottom: 1px solid #e8edf5;
    overflow: hidden;
}

.practice-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4f5fe0 0%, #818cf8 100%);
}

.practice-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #6366f110 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.practice-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.practice-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.practice-header-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.practice-breadcrumb {
    font-size: 10.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #4f5fe0;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.practice-breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s;
}

.practice-breadcrumb a:hover { color: #4f5fe0; }
.practice-breadcrumb-sep { color: #cbd5e1; }

.practice-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: #0f172a;
    line-height: 1.1;
    margin: 0 0 3px;
    text-transform: capitalize;
}

.practice-header p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Overall progress summary pill */
.practice-header-progress {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.php-overall-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
}

.php-overall-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.php-overall-bar {
    width: 120px;
    height: 6px;
    background: #e8edf5;
    border-radius: 99px;
    overflow: hidden;
}

.php-overall-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f5fe0, #818cf8);
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

.php-overall-pct {
    font-size: 13px;
    font-weight: 700;
    color: #4f5fe0;
    min-width: 36px;
    text-align: right;
}

/* Stats row */
.practice-header-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.ph-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #64748b;
}

.ph-stat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ph-stat-dot.not-started { background: #e2e8f0; } /* not attempted */
.ph-stat-dot.in-progress { background: #f59e0b; } /* attempted, score < 70% */
.ph-stat-dot.completed   { background: #10b981; } /* score ≥ 70% (pass) */

/* ════════════════════════════════════════
   TOPICS SECTION
════════════════════════════════════════ */
.topics-section {
    padding: 26px 40px 40px;
    flex: 1;
}

.topics-section h2 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 18px;
    font-family: 'Outfit', sans-serif;
    animation: tpFadeUp 0.5s ease both;
}

/* ════════════════════════════════════════
   TOPICS GRID
════════════════════════════════════════ */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* ════════════════════════════════════════
   TOPIC CARD
════════════════════════════════════════ */
.topic-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    padding: 15px 16px 13px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(.22,.68,0,1.3),
                box-shadow 0.22s ease,
                border-color 0.18s;
    animation: tpFadeUp 0.4s ease both;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Stagger first 15 */
.topic-card:nth-child(1)  { animation-delay: 0.04s; }
.topic-card:nth-child(2)  { animation-delay: 0.07s; }
.topic-card:nth-child(3)  { animation-delay: 0.10s; }
.topic-card:nth-child(4)  { animation-delay: 0.13s; }
.topic-card:nth-child(5)  { animation-delay: 0.16s; }
.topic-card:nth-child(6)  { animation-delay: 0.19s; }
.topic-card:nth-child(7)  { animation-delay: 0.22s; }
.topic-card:nth-child(8)  { animation-delay: 0.25s; }
.topic-card:nth-child(9)  { animation-delay: 0.28s; }
.topic-card:nth-child(10) { animation-delay: 0.31s; }
.topic-card:nth-child(11) { animation-delay: 0.34s; }
.topic-card:nth-child(12) { animation-delay: 0.37s; }
.topic-card:nth-child(13) { animation-delay: 0.40s; }
.topic-card:nth-child(14) { animation-delay: 0.43s; }
.topic-card:nth-child(15) { animation-delay: 0.46s; }

/* Status top micro-bar */
.topic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2.5px;
    border-radius: 12px 12px 0 0;
    background: #f1f5f9;
    transition: background 0.2s;
}

/* Hover */
@media (hover: hover) {
    .topic-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(79, 95, 224, 0.11);
        border-color: #c7d2fe;
    }
}

.topic-card:active { transform: scale(0.98); }

/* ── TOPIC LINK ── */
.topic-card a {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: block;
    margin-bottom: 10px;
    transition: color 0.15s;
    /* stretch link to cover entire card */
    position: static;
}

/* Make entire card clickable via the link */
.topic-card a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

@media (hover: hover) {
    .topic-card:hover a { color: #4f5fe0; }
}

/* ── SCORE BADGE ── */
.topic-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 6px;
}

.score-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    flex-shrink: 0;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* ── STATE: Not attempted ── */
.topic-card.state-not-started::before { background: #e2e8f0; }

.topic-card.state-not-started .score-badge {
    background: #f1f5f9;
    color: #94a3b8;
}

.topic-card.state-not-started .score-label {
    color: #cbd5e1;
}

/* ── STATE: Attempted, below pass (1-69%) ── */
.topic-card.state-in-progress::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.topic-card.state-in-progress .score-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* ── STATE: Passed (70%+) ── */
.topic-card.state-completed::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.topic-card.state-completed .score-badge {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.topic-card.state-completed a { color: #0f766e; }

/* ════════════════════════════════════════
   TABLET  640px – 1023px
════════════════════════════════════════ */
@media (max-width: 1023px) {
    .practice-header    { padding: 24px 24px 20px; }
    .practice-header h1 { font-size: 22px; }
    .topics-section     { padding: 20px 24px 36px; }
    /* Fixed 3-col on tablet — many topics, 3-col reads well */
    .topics-grid        { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .php-overall-bar    { width: 90px; }
}

/* ════════════════════════════════════════
   MOBILE  < 640px
════════════════════════════════════════ */
@media (max-width: 639px) {
    /* Clear the fixed 58px mobile topbar */
    /* Clear fixed 58px topbar */
    .dashboard-content {
        padding-top: 58px !important;
        margin-left: 0 !important;
    }

    .practice-header {
        margin-top: 58px;
        padding: 16px 16px 14px;
    }

    .practice-header::before { width: 3px; }

    .practice-header-inner { flex-direction: column; gap: 12px; }

    .practice-header-left { gap: 12px; }

    .practice-header-icon {
        width: 40px; height: 40px;
        font-size: 20px; border-radius: 10px;
    }

    .practice-header h1 { font-size: 18px; }
    .practice-header p  { font-size: 12px; }

    /* Move overall bar below heading on mobile */
    .practice-header-progress {
        align-items: flex-start;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .php-overall-bar { width: 100px; flex: 1; }
    .php-overall-label { display: none; }

    .practice-header-stats { gap: 10px; margin-top: 8px; }
    .ph-stat { font-size: 11px; }

    .topics-section { padding: 14px 12px 28px; }

    /* 2 columns on mobile */
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .topic-card {
        padding: 12px 12px 10px;
        border-radius: 10px;
    }

    .topic-card a {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .score-label { font-size: 9px; }
    .score-badge { font-size: 11px; padding: 2px 7px; }
}

/* Extra small < 380px — single column */
@media (max-width: 379px) {
    .topics-grid { grid-template-columns: 1fr; }
}

/* ── ANIMATION ── */
@keyframes tpFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}   