/* 
 * Dashboard Stylesheet
 * NITS Tech Systems Learning Management System
 * Moodle/VUMA Inspired Layout
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --primary-dark: #357ae8;
    --secondary-color: #2c3e50;
    --accent-color: #00c853;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --text-color: #333;
    --text-light: #666;
    --white: #ffffff;
    --sidebar-width: 250px;
    --header-height: 60px;
    --border-radius: 6px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-logo {
    height: 40px;
    margin-bottom: 10px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.sidebar-title span {
    color: var(--primary-color);
}

.sidebar-user {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    font-weight: bold;
    border: 3px solid var(--primary-color);
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-role {
    font-size: 0.85rem;
    color: #bdc3c7;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
}

.user-role.student {
    background-color: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
}

.user-role.teacher {
    background-color: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.user-role.assistant {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.user-role.admin {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.85rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--white);
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

/* Header */
.dashboard-header {
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 5px;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-notification {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Content Area */
.dashboard-content {
    padding: 30px;
}

.content-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: var(--transition);
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--medium-gray);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.widget-actions {
    display: flex;
    gap: 10px;
}

.widget-action {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.widget-action:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.widget-content {
    min-height: 150px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.primary {
    background-color: var(--primary-color);
}

.stat-icon.success {
    background-color: var(--accent-color);
}

.stat-icon.warning {
    background-color: var(--warning-color);
}

.stat-icon.danger {
    background-color: var(--danger-color);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--accent-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Course Cards */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.course-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.course-header {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    position: relative;
    padding: 20px;
    color: white;
}

.course-code {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.course-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.course-instructor {
    font-size: 0.9rem;
    opacity: 0.8;
}

.course-progress {
    position: absolute;
    bottom: -20px;
    left: 20px;
    right: 20px;
}

.progress-bar {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
    text-align: right;
}

.course-content {
    padding: 30px 20px 20px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.course-description {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.5;
}

.course-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--medium-gray);
}

.btn-success {
    background-color: var(--accent-color);
    color: white;
}

.btn-success:hover {
    background-color: #00b247;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Activity Feed */
.activity-feed {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.activity-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Calendar Widget */
.calendar-widget {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    padding: 10px;
    font-size: 0.9rem;
}

.calendar-day {
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background-color: var(--light-gray);
}

.calendar-day.active {
    background-color: var(--primary-color);
    color: white;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
}

.calendar-day.other-month {
    color: var(--medium-gray);
}

.calendar-events {
    margin-top: 20px;
}

.calendar-event {
    padding: 10px;
    border-left: 3px solid var(--primary-color);
    background-color: var(--light-gray);
    margin-bottom: 10px;
    border-radius: 4px;
}

.calendar-event-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.calendar-event-time {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Footer */
.dashboard-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--medium-gray);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header-search {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 20px;
    }
    
    .dashboard-widgets,
    .stats-grid,
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .header-search {
        display: none;
    }
    
    .widget-content {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 0 15px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .dashboard-content {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Overlay for mobile menu */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--medium-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--secondary-color);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--accent-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-info {
    background-color: var(--text-light);
    color: white;
}