/* Student Dashboard Layout Stylesheet */

.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Sidebar Profile Card */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: var(--primary-medium);
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    border: 3px solid var(--primary-light);
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.profile-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Sidebar Nav Links */
.dashboard-nav {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.dashboard-nav-item:hover, .dashboard-nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Dashboard Content & Metrics */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-welcome h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

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

/* Dashboard Overview Cards */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.metric-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.widget-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.widget-info p {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.icon-blue { background-color: #eff6ff; color: #2563eb; }
.icon-green { background-color: #ecfdf5; color: #059669; }
.icon-purple { background-color: #faf5ff; color: #7c3aed; }

/* Dashboard Tables */
.dashboard-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

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

.dashboard-section-title {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Table Style */
.attempts-table-wrapper {
    overflow-x: auto;
}

.attempts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.attempts-table th {
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

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

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

.score-badge {
    font-weight: 700;
    color: var(--primary);
}

.status-flag {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.status-completed {
    background-color: var(--success-light);
    color: var(--success);
}

.status-paused {
    background-color: var(--info-light);
    color: var(--info);
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media(max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .dashboard-sidebar {
        gap: 12px;
    }
    .profile-card {
        padding: 20px;
    }
    .dashboard-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 8px;
        scrollbar-width: none; /* Firefox */
    }
    .dashboard-nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .dashboard-nav-item {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 0.85rem;
        scroll-snap-align: start;
        white-space: nowrap;
    }
    .metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
    }
}

@media(max-width: 600px) {
    .dashboard-welcome h2 {
        font-size: 1.4rem;
    }
    
    .profile-card {
        display: grid;
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto auto;
        align-items: center;
        text-align: left;
        padding: 16px;
        gap: 2px 16px;
    }
    
    .profile-avatar-large {
        grid-row: span 3;
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        margin: 0;
        border-width: 2px;
    }
    
    .profile-name {
        grid-column: 2;
        margin: 0;
        font-size: 1.1rem;
    }
    
    .profile-email {
        grid-column: 2;
        margin: 0 0 4px 0;
        font-size: 0.8rem;
    }
    
    .profile-badge {
        grid-column: 2;
        justify-self: start;
        padding: 2px 8px;
        font-size: 0.7rem;
    }
    
    .dashboard-main {
        gap: 20px;
    }
    
    .metric-widget {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .widget-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .widget-info h4 {
        font-size: 0.75rem;
    }
    
    .widget-info p {
        font-size: 1.3rem;
    }
    
    .dashboard-section {
        padding: 16px;
    }
    
    /* Responsive Card-Based Attempts Table for Mobile */
    .attempts-table-wrapper {
        overflow-x: visible;
    }
    
    .attempts-table thead {
        display: none; /* Hide traditional table headers on mobile */
    }
    
    .attempts-table tbody,
    .attempts-table tr,
    .attempts-table td {
        display: block;
        width: 100%;
    }
    
    .attempts-table tr {
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
        padding: 14px 16px;
        box-shadow: var(--shadow-sm);
    }
    
    .attempts-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px dashed var(--border-color);
        text-align: right;
        font-size: 0.85rem;
    }
    
    .attempts-table td:last-child {
        border-bottom: none;
        padding-top: 14px;
        justify-content: flex-end; /* Center or align the action button */
    }
    
    .attempts-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Override empty state inside table cards */
    .attempts-table td.empty-state {
        display: block;
        text-align: center;
        border: none;
        padding: 30px 10px;
    }
    
    .attempts-table td.empty-state::before {
        display: none;
    }
}

