/**
 * Dashboard styles for Rajasthan Virtual Shiksha PWA
 */

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.dashboard-main {
    flex: 1;
    padding: 20px;
    background-color: var(--bg-light);
    overflow-y: auto;
}

/* Dashboard Header */
.dashboard-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-title {
    font-size: 1.5rem;
    margin: 0 0 0 15px;
    color: white;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 40px;
    width: auto;
}

/* User Controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.emoji-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid var(--border-color);
}

.user-name {
    font-weight: 500;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 150px;
    display: none;
    z-index: 100;
}

.user-profile:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
}

/* Online Status Indicator */
#online-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

#online-status.online {
    background-color: #4CAF50;
    box-shadow: 0 0 5px #4CAF50;
}

#online-status.offline {
    background-color: #F44336;
    box-shadow: 0 0 5px #F44336;
}

/* Sidebar Navigation */
.dashboard-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-nav li {
    margin: 0;
    padding: 0;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background-color 0.2s;
    gap: 12px;
}

.dashboard-nav a:hover {
    background-color: var(--sidebar-hover);
}

.dashboard-nav li.active a {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

.dashboard-nav svg {
    width: 20px;
    height: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.theme-switcher,
.language-switcher {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-light);
    color: var(--text-color);
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.welcome-banner h2 {
    margin-top: 0;
    font-size: 1.8rem;
}

.welcome-banner p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.attendance {
    background-color: #4CAF50;
}

.stat-icon.assignments {
    background-color: #2196F3;
}

.stat-icon.quizzes {
    background-color: #FF9800;
}

.stat-icon.downloads {
    background-color: #9C27B0;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 5px 0 0;
    color: var(--text-color);
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* Class Cards */
.class-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.class-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.class-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.class-card.live {
    border-left: 4px solid #F44336;
}

.class-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.class-card.live .class-status {
    background-color: #F44336;
    color: white;
}

.class-card:not(.live) .class-status {
    background-color: var(--bg-light);
    color: var(--text-muted);
}

.class-card h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.class-time, .class-instructor {
    margin: 5px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.class-actions {
    margin-top: 15px;
}

/* Assignment List */
.assignment-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.assignment-item {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.assignment-item:last-child {
    border-bottom: none;
}

.assignment-info h3 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.assignment-course, .assignment-due {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.assignment-due {
    color: #F44336;
    font-weight: 500;
}

/* Download List */
.download-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.download-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.download-item:last-child {
    border-bottom: none;
}

.download-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.download-icon.pdf {
    background-color: #F44336;
}

.download-icon.video {
    background-color: #2196F3;
}

.download-info {
    flex: 1;
}

.download-info h3 {
    margin: 0 0 5px;
    font-size: 0.95rem;
}

.download-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Notification Container */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin-top: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
}

.notification-title {
    margin: 0 0 5px;
    font-size: 1rem;
    font-weight: 500;
}

.notification-message {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dashboard-nav ul {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .dashboard-nav a {
        flex-direction: column;
        padding: 10px;
        text-align: center;
        min-width: 80px;
    }
    
    .dashboard-nav span {
        font-size: 0.8rem;
    }
    
    .sidebar-footer {
        display: none;
    }
}

@media (max-width: 768px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .class-cards {
        grid-template-columns: 1fr;
    }
    
    .assignment-item, .download-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .assignment-actions, .download-actions {
        margin-top: 10px;
        align-self: flex-end;
    }
    
    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header .container {
        flex-wrap: wrap;
    }
    
    .dashboard-title {
        font-size: 1.2rem;
    }
}
