/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-off-white);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 92, 231, 0.08);
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-light);
}

.sidebar-credits {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--bg-off-white);
    border-radius: var(--radius-md);
}

.credits-ring {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.credits-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.credits-info {
    display: flex;
    flex-direction: column;
}

.credits-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.credits-upgrade {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

/* ==================== TOP BAR ==================== */
.topbar {
    height: 64px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.topbar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    background: var(--bg-off-white);
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-btn:hover {
    background: var(--bg-off-white);
    color: var(--text-primary);
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.user-menu-btn:hover {
    background: var(--bg-off-white);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 200;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-off-white);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 6px 0;
}

.user-dropdown .logout {
    color: #ff6b6b;
}

.user-dropdown .logout:hover {
    background: rgba(255, 107, 107, 0.06);
}

/* ==================== DASHBOARD CONTENT ==================== */
.dashboard-content {
    padding: 32px 24px;
    max-width: 1200px;
}

/* Welcome Section */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.welcome-text h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.welcome-text p {
    color: var(--text-secondary);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header-bar h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.card-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Recent Exams List */
.recent-exams-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-exam-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.recent-exam-item:hover {
    background: var(--bg-off-white);
    border-color: var(--border-medium);
}

.exam-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.exam-item-icon.neet { background: #6c5ce7; }
.exam-item-icon.jee { background: #00b894; }
.exam-item-icon.fpge { background: #fd79a8; }
.exam-item-icon.cat { background: #e17055; }

.exam-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exam-item-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.exam-item-score {
    font-weight: 800;
    font-size: 1.1rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.exam-item-score.good { color: #00b894; background: rgba(0, 184, 148, 0.08); }
.exam-item-score.avg { color: #d4a853; background: rgba(212, 168, 83, 0.08); }
.exam-item-score.low { color: #ff6b6b; background: rgba(255, 107, 107, 0.08); }

.card-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.card-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.card-empty a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.quick-action-card:hover {
    border-color: var(--accent-primary-light);
    background: rgba(108, 92, 231, 0.03);
    transform: translateY(-2px);
}

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-off-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Exam Type Tags */
.exam-type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exam-tag {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.exam-tag:hover {
    border-color: var(--accent-primary-light);
}

.exam-tag.active {
    background: rgba(108, 92, 231, 0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.exam-tag.add-tag {
    border-style: dashed;
    color: var(--text-muted);
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    margin-bottom: 28px;
}

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

.page-header p {
    color: var(--text-secondary);
}

.page-filters {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.filter-select {
    width: auto;
    min-width: 160px;
}

/* ==================== PROFILE PAGE ==================== */
.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
}

.profile-avatar-section {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto 14px;
}

.profile-avatar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.profile-avatar-section p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.profile-plan-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(108, 92, 231, 0.08);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-form-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.settings-group {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-group h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--accent-green);
    margin-top: 4px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ==================== CREDITS PAGE ==================== */
.credit-balance-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balance-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.balance-amount span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.balance-tier {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-off-white);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: fit-content;
}

.credits-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.credit-pricing-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: all var(--transition-base);
}

.credit-pricing-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.credit-pricing-card:first-child {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.credit-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 5px 16px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.credit-pricing-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.credit-price {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.credit-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.credit-amount {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 20px;
}

.credit-pricing-card ul {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.credit-pricing-card ul li {
    padding: 8px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.credit-pricing-card ul li::before {
    content: '✓ ';
    color: var(--accent-green);
    font-weight: 700;
}

.credit-plus {
    color: #00b894;
    font-weight: 700;
}

/* ==================== PERFORMANCE CHART ==================== */
.performance-chart-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.performance-chart-card h3 {
    margin-bottom: 20px;
}

.chart-placeholder {
    padding: 20px 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 180px;
    padding: 0 10px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #6c5ce7, #a29bfe);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 0.6s ease;
    min-height: 20px;
}

.chart-bar span {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.chart-labels {
    display: flex;
    gap: 16px;
    padding: 10px 10px 0;
}

.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ==================== HISTORY TABLE ==================== */
.history-table-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-off-white);
    border-bottom: 1px solid var(--border-light);
}

.history-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: var(--bg-off-white);
}

.exam-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exam-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.exam-icon-sm.neet { background: #6c5ce7; }
.exam-icon-sm.jee { background: #00b894; }
.exam-icon-sm.fpge { background: #fd79a8; }
.exam-icon-sm.cat { background: #e17055; }

.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
}

.score-badge.good { background: rgba(0, 184, 148, 0.1); color: #00b894; }
.score-badge.avg { background: rgba(212, 168, 83, 0.1); color: #d4a853; }
.score-badge.low { background: rgba(255, 107, 107, 0.1); color: #ff6b6b; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .credits-pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .credit-balance-card {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .history-table {
        font-size: 0.8rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .page-filters {
        flex-direction: column;
    }
}