/* ═══════════════════════════════════════════════════════
   MY PREPARATION PAGE — Premium CSS
   ═══════════════════════════════════════════════════════ */

/* --- Page Header --- */
.prep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    padding: 2rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px -10px rgba(79, 70, 229, 0.5);
    position: relative;
    overflow: hidden;
}

.prep-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -5%;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.prep-header h2 {
    font-weight: 800;
    color: white;
    margin: 0;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    z-index: 1;
}

.exam-goal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.exam-goal-badge:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
}

.exam-goal-badge i {
    font-size: 1.1rem;
}

/* --- Tab Pills --- */
.prep-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f1f5f9;
    border-radius: 16px;
    padding: 6px;
    width: fit-content;
}

.prep-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.prep-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.prep-tab:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.prep-tab.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.prep-tab .tab-icon {
    font-size: 1.2rem;
}

.prep-tab .tab-count {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.prep-tab.active .tab-count {
    background: #4f46e5;
    color: white;
}

/* --- Tab Content Sections --- */
.prep-tab-content {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.prep-tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Test Cards (Enhanced) --- */
.test-card {
    border: none;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #4f46e5, #d946ef, #10b981);
    z-index: 0;
    opacity: 0.8;
}

.test-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.2);
}

.test-card .card-body {
    padding: 1.75rem;
    position: relative;
    z-index: 1;
}

.test-card .test-type-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px -3px rgba(0,0,0,0.1);
}

.test-card .card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.test-card .card-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.test-card .test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px dashed #e2e8f0;
    margin-bottom: 1.25rem;
}

.test-card .test-meta span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-card .test-meta span i {
    color: #4f46e5;
    font-size: 1rem;
}

.test-card .btn-attempt {
    width: 100%;
    padding: 0.8rem;
    font-weight: 700;
    border-radius: 14px;
    font-size: 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px -3px rgba(79, 70, 229, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.test-card .btn-attempt:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    box-shadow: 0 8px 25px -4px rgba(79, 70, 229, 0.6);
    transform: translateY(-2px);
}

/* Test type colors */
.badge-topic { background: #dbeafe; color: #1d4ed8; }
.badge-chapter { background: #fce7f3; color: #be185d; }
.badge-subject { background: #dcfce7; color: #15803d; }
.badge-mini { background: #fef9c3; color: #a16207; }
.badge-important { background: #fee2e2; color: #dc2626; }
.badge-full { background: #ede9fe; color: #7c3aed; }

/* --- Notes Section --- */
.notes-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.notes-breadcrumb .crumb {
    font-size: 0.9rem;
    color: #4f46e5;
    cursor: pointer;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.notes-breadcrumb .crumb:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.notes-breadcrumb .crumb-active {
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 800;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.notes-breadcrumb .crumb-sep {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* --- Category Folder Cards --- */
.category-folder {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 20px;
    border: none;
    background: white;
    box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-folder::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: #cbd5e1;
    transition: background 0.3s;
}

.category-folder:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.15);
}

.category-folder:hover::before {
    background: linear-gradient(to bottom, #4f46e5, #ec4899);
}

.category-folder .folder-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f1f5f9, #ffffff);
    color: #64748b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.category-folder .folder-info {
    flex: 1;
    min-width: 0;
}

.category-folder .folder-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.category-folder .folder-meta {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.category-folder .folder-arrow {
    color: #94a3b8;
    font-size: 1.2rem;
    transition: all 0.3s;
    background: #f8fafc;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.category-folder:hover .folder-arrow {
    transform: translateX(5px);
    color: white;
    background: #4f46e5;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Cycling pastel colors for folder icons */
.folder-color-1 { background: #e0e7ff; color: #4f46e5; }
.folder-color-2 { background: #fce7f3; color: #ec4899; }
.folder-color-3 { background: #dcfce7; color: #16a34a; }
.folder-color-4 { background: #fef3c7; color: #d97706; }
.folder-color-5 { background: #e0f2fe; color: #0284c7; }
.folder-color-6 { background: #fae8ff; color: #a855f7; }

/* --- PDF Items --- */
.pdf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: white;
    border: none;
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pdf-item:hover {
    transform: translateX(6px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.15);
}

.pdf-item.locked {
    background: #f8fafc;
    opacity: 0.95;
    border: 1px dashed #cbd5e1;
}

.pdf-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pdf-icon {
    font-size: 1.8rem;
    color: #ef4444;
}

.pdf-item.locked .pdf-icon {
    color: #94a3b8;
}

.pdf-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pdf-item .badge-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

.pdf-item .btn-read {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.pdf-item .btn-read:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
    color: white;
}

.pdf-item .btn-unlock {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pdf-item .btn-unlock:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* --- Wallet Info Strip --- */
.wallet-strip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #92400e;
}

.wallet-strip i {
    font-size: 1rem;
}

/* --- Empty / Loading States --- */
.prep-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.prep-empty-state img {
    width: 120px;
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

.prep-empty-state h5 {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.prep-empty-state p {
    color: #94a3b8;
    max-width: 400px;
    margin: 0 auto;
}

.prep-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.prep-spinner p {
    color: #94a3b8;
    font-weight: 500;
}

/* --- Stats Section (Now Acts as Tabs) --- */
.prep-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 600px) {
    .prep-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.stat-card {
    background: white;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.3);
}

.stat-card.active {
    border-color: #4f46e5;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 0 15px 35px -5px rgba(79, 70, 229, 0.2);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 15px -3px rgba(0,0,0,0.1);
}

.stat-card .stat-info h4 {
    font-weight: 800;
    font-size: 1.8rem;
    color: #0f172a;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-card .stat-info p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 4px 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .prep-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prep-tabs {
        width: 100%;
    }

    .prep-tab {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .pdf-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pdf-item .btn-read,
    .pdf-item .btn-unlock {
        width: 100%;
        text-align: center;
    }

    .test-card .card-body {
        padding: 1.25rem;
    }

    .category-folder {
        padding: 1rem;
    }

    .prep-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .prep-stats {
        grid-template-columns: 1fr;
    }
}

/* --- Gold Icon & Premium Badge (from existing) --- */
.text-gold {
    color: #FFD700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.badge-premium {
    font-size: 0.6rem !important;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000 !important;
    font-weight: 700;
    margin-left: auto;
    border: 1px solid #e0c200;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sticky-nav-item {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--sidebar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.badge-live {
    font-size: 0.6rem !important;
    background-color: #ef4444;
    color: white !important;
    font-weight: 700;
    margin-left: auto;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: blinkLive 1.5s infinite;
}

@keyframes blinkLive {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.sidebar-header {
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-name {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.4rem;
    text-transform: lowercase;
}

.brand-tagline {
    font-size: 0.65rem;
    color: var(--sidebar-link-color);
    display: block;
    margin-top: -2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
