/* ========================================
   Dashboard Page Styles
   ======================================== */

.dashboard-content {
    padding: 3rem 0;
}

/* ========================================
   Welcome Section
   ======================================== */

.welcome-section {
    margin-bottom: 3rem;
}

.welcome-header {
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

/* ========================================
   Stats Cards
   ======================================== */

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    flex-shrink: 0;
}

.stat-icon-exams {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.stat-icon-completed {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
}

.stat-icon-score {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
}

.stat-icon-time {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}

/* ========================================
   Dashboard Section
   ======================================== */

.dashboard-section {
    margin-bottom: 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}

.section-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.section-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ========================================
   Available Exams Grid (Reuse Browse Styles)
   ======================================== */

.available-exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.exam-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border-top: 4px solid var(--color-primary);
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.exam-header {
    margin-bottom: 1rem;
}

.exam-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.exam-category {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.exam-description {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-gray-300);
}

.exam-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.exam-meta-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

.exam-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-secondary);
}

.exam-price.free {
    color: var(--color-primary);
}

/* ========================================
   Results Table
   ======================================== */

.table-wrapper {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.results-table thead {
    background: var(--color-gray-100);
}

.results-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--color-gray-200);
    transition: background-color 0.2s ease;
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background-color: var(--color-gray-100);
}

.results-table td {
    padding: 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text);
}

.exam-name-cell {
    max-width: 280px;
}

.table-exam-title {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.table-exam-category {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* ========================================
   Badges
   ======================================== */

.score-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.score-excellent {
    background-color: #d1fae5;
    color: #065f46;
}

.score-good {
    background-color: #dbeafe;
    color: #1e40af;
}

.score-average {
    background-color: #fef3c7;
    color: #92400e;
}

.score-poor {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-passed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-new {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-purchased {
    background-color: #dbeafe;
    color: #1e40af;
}

.attempt-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-gray-200);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   Action Buttons
   ======================================== */

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--color-primary);
}

.btn-icon:hover {
    background-color: var(--color-gray-100);
    color: var(--color-primary-dark);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Performance Analytics
   ======================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-gray-100);
    border-radius: var(--radius-xl);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--color-gray-400);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 968px) {
    .welcome-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

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

    .table-wrapper {
        overflow-x: auto;
    }

    .results-table {
        min-width: 800px;
    }
}

@media (max-width: 640px) {
    .dashboard-content {
        padding: 2rem 0;
    }

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

    .welcome-title {
        font-size: 1.75rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .available-exams-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        gap: 1.5rem;
    }

    .chart-card {
        padding: 1.5rem;
    }

    .chart-container {
        height: 250px;
    }
}
