/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* View Selector */
.view-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.view-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.view-btn i {
    font-size: 16px;
}

/* View Container */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.student-header {
    border-left: 4px solid var(--primary-color);
}

.admin-header {
    border-left: 4px solid var(--danger-color);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 8px;
    flex: 1;
}

.nav-link {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--bg-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* User Menu Dropdown */
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-color);
}

.dropdown-item i {
    width: 20px;
    color: var(--text-secondary);
}

.dropdown-item.logout-item {
    color: var(--danger-color);
}

.dropdown-item.logout-item:hover {
    background: #fee2e2;
}

.dropdown-item.logout-item i {
    color: var(--danger-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.stat-change {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--success-color);
}

/* Content Section */
.content-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

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

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.course-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--card-bg);
}

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

.course-header {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-badge.new {
    background: var(--success-color);
}

.course-body {
    padding: 1.5rem;
}

.course-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar-container {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-color);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

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

/* Assignments List */
.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assignment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.assignment-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.assignment-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.assignment-icon.urgent {
    background: #fef3c7;
    color: var(--warning-color);
}

.assignment-info {
    flex: 1;
}

.assignment-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.assignment-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.due-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.assignment-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #fef3c7;
    color: var(--warning-color);
}

.status-badge.in-progress {
    background: #dbeafe;
    color: var(--primary-color);
}

.status-badge.active {
    background: #d1fae5;
    color: var(--success-color);
}

.status-badge.completed {
    background: #d1fae5;
    color: var(--success-color);
}

/* Admin Specific Styles */
.two-column-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Students List */
.students-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.student-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.student-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.student-info {
    flex: 1;
}

.student-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.student-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.student-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.student-badge.enrolled {
    background: #dbeafe;
    color: var(--primary-color);
}

.student-badge.active {
    background: #d1fae5;
    color: var(--success-color);
}

.student-badge.completed {
    background: #fed7d7;
    color: var(--danger-color);
}

.student-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 100px;
}

.mini-progress-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-color);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-bar .progress-fill {
    height: 100%;
    background: var(--primary-color);
}

/* Courses Table */
.courses-table {
    overflow-x: auto;
}

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

.courses-table thead {
    background: var(--bg-color);
}

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

.courses-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.course-cell {
    display: flex;
    flex-direction: column;
}

.course-cell strong {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.course-cell span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar-small {
    width: 80px;
    height: 6px;
    background: var(--bg-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

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

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

.action-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.action-card span {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

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

.review-student {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.review-student strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.review-student span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.time-ago {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.review-course {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
}

.badge-count {
    background: var(--danger-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Chart Placeholder */
.chart-placeholder {
    padding: 2rem 1rem 1rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px 4px 0 0;
    min-height: 20px;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .main-content {
        padding: 1rem;
    }

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

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

    .view-selector {
        top: 10px;
        right: 10px;
    }

    .view-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

