:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --glass: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    height: 100vh;
    width: 100vw;
    transition: grid-template-columns 0.3s ease;
}

.app-container.right-panel-hidden {
    grid-template-columns: 260px 1fr;
}

.app-container.right-panel-hidden .right-panel {
    display: none;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.logo span span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 13px;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-item.active {
    background-color: #eef2ff;
    color: var(--primary);
}

.nav-item i {
    width: 16px;
    height: 16px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
}

.logout-btn:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Main Content Styling */
.main-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 32px;
    background-color: var(--bg-main);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i, .search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
    background-color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.add-new-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

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

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #ddd6fe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Views Styling */
.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-section {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: var(--radius-lg);
    padding: 40px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-text h1 {
    font-size: 32px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 8px;
}

.hero-text p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.btn-primary {
    background-color: white;
    color: var(--primary);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.hero-image img {
    height: 180px;
    z-index: 1;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.purple { background-color: #eef2ff; color: var(--primary); }
.stat-icon.blue { background-color: #ecfdf5; color: #10b981; }
.stat-icon.orange { background-color: #fff7ed; color: #f59e0b; }

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables */
.recent-activity {
    background-color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.view-all {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.table-container {
    width: 100%;
}

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

th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active { background-color: #ecfdf5; color: #059669; }
.status-pending { background-color: #fff7ed; color: #d97706; }

/* Right Panel Styling */
.right-panel {
    background-color: white;
    border-left: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
}

.calendar-widget {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-lg);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-header h3 { font-size: 16px; }

.calendar-nav button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.calendar-grid-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.day:hover { background-color: #e2e8f0; }
.day.today { background-color: var(--primary); color: white; font-weight: 700; }
.day.has-lesson { position: relative; }
.day.has-lesson::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 50%;
}

.reminders-section h3 { font-size: 16px; margin-bottom: 16px; }

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
}

.reminder-item:hover { transform: translateX(5px); }

.reminder-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.reminder-text { font-size: 14px; flex: 1; }
.reminder-time { font-size: 12px; color: var(--text-muted); }

.ai-mini-tip {
    background: linear-gradient(135deg, #fef3c7, #fff7ed);
    padding: 20px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent);
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-mini-tip p {
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.active { display: flex; }

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 720px;
    max-width: 95%;
    max-height: 95vh;
    overflow-y: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes slideInModal {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary { background: #f1f5f9; color: var(--text-main); border: none; padding: 10px 20px; border-radius: var(--radius-md); cursor: pointer; }

/* Custom Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background-color: #1e293b;
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Notes View Specifics */
.notes-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

.notes-sidebar {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    overflow-y: auto;
}

.note-editor {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    overflow-y: auto;
}

.note-item {
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 8px;
}

.note-item:hover { background-color: #f1f5f9; }
.note-item.active { background-color: #eef2ff; border-left: 4px solid var(--primary); }

/* AI Insights Specifics */
.ai-banner {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.ai-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.ai-tip-card {
    background-color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.placeholder-editor {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
    font-size: 18px;
}

/* Animations */
.nav-item, .btn-primary, .stat-card, .reminder-item, .add-new-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.add-new-btn:active { transform: scale(0.95); }

/* Note Editor refinement */
#note-content-input::-webkit-scrollbar { width: 4px; }
#note-title-input::placeholder { color: #cbd5e1; }

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 80px 1fr 300px;
    }
    .sidebar span, .sidebar .logo span { display: none; }
    .sidebar { padding: 16px; align-items: center; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item span { display: none; }
}

/* Sidebar sections & badges */
.sidebar-section-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin: 10px 8px 4px 8px;
    text-transform: uppercase;
}

.nav-badge {
    background-color: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    transition: all 0.2s;
}

/* Task list item styles */
.task-item {
    transition: transform 0.2s, box-shadow 0.2s;
}
.task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Tab buttons for group editor */
.modal-tabs-header {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.edit-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.edit-tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Custom Add Reminder Button */
#add-reminder-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#add-reminder-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.08) rotate(90deg);
}

#add-reminder-btn i {
    width: 16px;
    height: 16px;
}

/* Slide in from right animation for realtime reminder alerts */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom color categories for navigation items */

/* BLUE/INDIGO THEME: O'QUV SECTION */
.nav-item-blue {
    color: #475569 !important;
}
.nav-item-blue i {
    color: #2563eb !important;
    transition: transform 0.2s;
}
.nav-item-blue:hover {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}
.nav-item-blue:hover i {
    transform: scale(1.1);
}
.nav-item-blue.active {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* PURPLE/VIOLET THEME: MARKETING SECTION */
.nav-item-purple {
    color: #475569 !important;
}
.nav-item-purple i {
    color: #8b5cf6 !important;
    transition: transform 0.2s;
}
.nav-item-purple:hover {
    background-color: #f5f3ff !important;
    color: #6d28d9 !important;
}
.nav-item-purple:hover i {
    transform: scale(1.1);
}
.nav-item-purple.active {
    background-color: #ede9fe !important;
    color: #5b21b6 !important;
}

/* ==========================================
   RESPONSIVE DESIGN & ADAPTABILITY
   ========================================== */

/* Large Desktop */
@media (max-width: 1440px) {
    .app-container {
        grid-template-columns: 240px 1fr 300px;
    }
    .app-container.right-panel-hidden {
        grid-template-columns: 240px 1fr;
    }
}

/* Medium screens & Laptops */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 220px 1fr 280px;
    }
    .app-container.right-panel-hidden {
        grid-template-columns: 220px 1fr;
    }
    .dashboard-columns-layout {
        grid-template-columns: 1fr; /* Stack columns on smaller laptops */
        gap: 20px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 80px 1fr; /* Collapse sidebar */
    }
    .app-container.right-panel-hidden {
        grid-template-columns: 80px 1fr;
    }
    .sidebar {
        padding: 24px 12px;
        align-items: center;
    }
    .sidebar .logo h2,
    .sidebar .nav-menu span,
    .sidebar .user-info {
        display: none; /* Hide text, only show icons */
    }
    .right-panel {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 300px;
        z-index: 100;
        background: var(--bg-main);
        box-shadow: var(--shadow-lg);
        transition: right 0.3s;
    }
    /* Hide right panel by default on tablets, can be toggled via JS if needed */
    .dashboard-grid .stats-cards {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for stats */
    }
}

/* Mobile */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .header-actions {
        justify-content: space-between;
    }
    .dashboard-grid .stats-cards {
        grid-template-columns: 1fr; /* 1 column for stats */
    }
    .tasks-grid,
    .groups-grid {
        grid-template-columns: 1fr !important;
    }
    .recent-activity table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* LMS Styles */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    background: white;
}

.accordion-header {
    background: #f8fafc;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-content {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: none;
    background: white;
    animation: slideDown 0.2s ease-out;
}

.accordion-content.active {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.rating-stars {
    display: flex;
    gap: 2px;
    color: #f59e0b;
}

.lecture-tab {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.lecture-tab:hover {
    color: var(--primary);
}

.lecture-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.group-card-compact {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
