:root {
    /* Complete Minimalism Palette */
    /* Primary: Strong Blue */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-rgb: 37, 99, 235;

    /* Secondary: Blue (Unified) */
    --secondary-color: #2563eb;
    --accent-color: #2563eb;

    /* Backgrounds - Pure & Flat */
    --background-color: #ffffff;
    /* Pure White Body */
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-secondary: #f8f9fa;
    /* Very subtle gray for contrast */
    --bg-input: #ffffff;
    /* Warm Gray 50 */
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-input: #ffffff;

    /* Typography - High Contrast */
    --surface-color: #ffffff;
    --text-color: #1f2937;
    /* Gray 800 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --text-light: #9ca3af;
    /* Gray 400 */

    /* Functional Colors */
    --success-color: #10b981;
    --success-rgb: 16, 185, 129;
    --warning-color: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --danger-color: #ef4444;
    --danger-rgb: 239, 68, 68;
    --info-color: #06b6d4;

    /* UI Elements */
    /* Shadows - Almost Non-Existent (Flat Design) */
    --card-shadow: none;
    --shadow-sm: none;
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Only for floating elements */
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    --border-color: #e5e7eb;
    /* Main definition comes from borders */
    --border-radius: 8px;
    /* Slightly tighter radius for cleaner look */

    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Ultra-smooth, gentle easing */
}

/* ... */

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    /* Very subtle lift */
    box-shadow: var(--shadow-md);
    color: white;
}

/* ... */

.course-card:hover {
    transform: translateY(-2px);
    /* Minimal movement */
    box-shadow: var(--shadow-lg);
    /* Soft depth instead of movement */
    border-color: #d1d5db;
}

/* Dark Mode - Deep */
/* Dark Mode - Deep */
.dark-mode {
    --bg-body: #0f172a;
    /* Slate 900 */
    --background-color: #0f172a;
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-secondary: #334155;
    /* Slate 700 */
    --bg-input: #1e293b;

    --text-color: #f1f5f9;
    /* Slate 100 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-light: #64748b;
    /* Slate 500 */

    --border-color: #334155;
    /* Slate 700 */

    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.dark-mode body,
.dark-mode html {
    background-color: var(--bg-body);
    color: var(--text-color);
}

.dark-mode .navbar {
    background-color: var(--bg-card);
    border-bottom-color: var(--border-color);
}

.dark-mode .nav-link {
    color: var(--text-color);
}

.dark-mode .nav-link:hover {
    color: var(--primary-color);
}

.dark-mode .card,
.dark-mode .course-card,
.dark-mode .content-area,
.dark-mode .sidebar {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-mode .form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-mode .form-control:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6,
.dark-mode label,
.dark-mode .module-title,
.dark-mode .step-item {
    color: var(--text-color);
}

.dark-mode .step-item:hover {
    background-color: var(--bg-secondary);
}

.dark-mode .text-muted,
.dark-mode .footer-desc,
.dark-mode .footer-contact-item span {
    color: var(--text-muted) !important;
}

.dark-mode .btn-outline {
    border-color: var(--text-muted);
    color: var(--text-color);
}

.dark-mode .btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

* {
    box-sizing: border-box;
}

body,
html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Navigation - Modern & Sleek */
.navbar {
    background-color: var(--bg-card);
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.03em;
}

.navbar-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
}

/* Buttons - Premium Feel */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    /* Hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    will-change: transform, background-color, box-shadow;

    /* Transitions */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    /* Base Outline Style */
    background-color: transparent;
    border: 1px solid transparent;
    font-family: inherit;
    gap: 0.5rem;
    box-shadow: none;
}

/* Primary, Secondary, Outline - Unified Blue Outline */
.btn-primary,
.btn-secondary,
.btn-outline {
    border-color: #e5e7eb;
    /* Default gentle gray border */
    color: #6b7280;
    /* Default gray text */
    background-color: transparent;
}

/* Active State / Hover for All Main Buttons */
.btn-primary:active,
.btn-secondary:active,
.btn-outline:active {
    background-color: #f3f4f6;
}

/* Hover - Blue Accent */
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* Success Button - Green Outline */
.btn-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background-color: transparent;
}

.btn-success:hover {
    background-color: rgba(16, 185, 129, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* Danger Button - Red Outline */
.btn-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background-color: transparent;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Info Button - Cyan Outline */
.btn-info {
    border-color: var(--info-color);
    color: var(--info-color);
    background-color: transparent;
}

.btn-info:hover {
    background-color: rgba(6, 182, 212, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

/* Layout & Containers */
.container {
    max-width: 1280px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    /* More breathing room */
    box-shadow: none;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    /* Clean border definition */
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #d1d5db;
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #ddd;
}

.course-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* Auth Pages */
.auth-container {
    max-width: 420px;
    margin: 4rem auto;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: #fdfdfd;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(106, 17, 203, 0.1);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header-modern {
    /* Clean solid background */
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
}

/* Course Content - Stepik Style */
.learn-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    height: calc(100vh - 100px);
    max-width: 1600px;
    margin: 0 auto;
}

.sidebar {
    background: white;
    border-right: 1px solid #eee;
    padding: 1.5rem;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.module-section {
    margin-bottom: 2rem;
}

.module-title {
    font-weight: 800;
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-item {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--text-color);
    font-weight: 500;
}

.step-item:hover {
    background: #f0f2f5;
    color: var(--primary-color);
}

.step-item.active {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.1), rgba(37, 117, 252, 0.1));
    color: var(--primary-color);
    font-weight: 700;
    border-left: 3px solid var(--primary-color);
}

.content-area {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow-y: auto;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.step-content {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

/* Quiz Styles */
.quiz-container {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    box-shadow: var(--card-shadow);
}

.question-block {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 5px solid var(--secondary-color);
    transition: var(--transition);
}

.options-list label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    background: white;
    border: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.options-list label:hover {
    background: #f1f3f5;
    border-color: #ced4da;
}

.options-list input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}


/* Editor - Visual Builder Style */
.full-screen-editor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    background: #f8f9fa;
    display: flex;
    overflow: hidden;
}

.editor-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #eef2f5;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

.editor-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.editor-sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.editor-canvas {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #f0f2f5;
    background-image: radial-gradient(#dee2e6 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
}

.editor-top-bar {
    background: transparent;
    padding: 1rem 0;
    height: auto;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    z-index: 5;
    flex-shrink: 0;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    /* key for centering */
}

.editor-workspace {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    /* Center the content */
    display: flex;
    justify-content: center;
}

.editor-page {
    background: white;
    width: 100%;
    max-width: 900px;
    min-height: 1000px;
    /* A4-ish ratio feel */
    border-radius: 2px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    padding: 4rem 5rem;
    position: relative;
    transition: var(--transition);
    margin: 3rem auto;
    /* Center with margin */
}

.editor-tools {
    width: 80px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0.5rem;
    gap: 0;
    z-index: 10;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.editor-tools.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-left: none;
}

.editor-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #eef2f5;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.editor-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
}

/* Toggle buttons for sidebars - BEAUTIFUL DESIGN */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4),
        0 0 0 0 rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-toggle:hover::before {
    opacity: 1;
}

.sidebar-toggle:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6),
        0 0 0 8px rgba(102, 126, 234, 0.1);
}

.sidebar-toggle:active {
    transform: translateY(-50%) scale(1.05);
}

.sidebar-toggle-left {
    left: 300px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s;
}

.editor-sidebar.collapsed+* .sidebar-toggle-left,
#left-sidebar.collapsed .sidebar-toggle-left {
    left: 12px;
}

.sidebar-toggle-right {
    right: 320px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s;
}

#right-sidebar.collapsed .sidebar-toggle-right {
    right: 12px;
}

.sidebar-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sidebar-toggle:hover i {
    transform: scale(1.1);
}

/* Icon rotation when sidebar is collapsed */
#left-sidebar.collapsed .sidebar-toggle-left i {
    transform: rotate(180deg);
}

#left-sidebar.collapsed .sidebar-toggle-left:hover i {
    transform: rotate(180deg) scale(1.1);
}

#right-sidebar.collapsed .sidebar-toggle-right i {
    transform: rotate(180deg);
}

#right-sidebar.collapsed .sidebar-toggle-right:hover i {
    transform: rotate(180deg) scale(1.1);
}

/* Pulse animation for attention */
@keyframes pulse-ring {
    0% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4),
            0 0 0 12px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Apply pulse on first load */
.sidebar-toggle.pulse {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.2, 1) 3;
}

/* Beautiful tooltip for toggle buttons */
.sidebar-toggle::after {
    content: attr(title);
    position: absolute;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.sidebar-toggle-left::after {
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
}

.sidebar-toggle-left:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar-toggle-right::after {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
}

.sidebar-toggle-right:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.tool-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    background: #ffffff;
    position: relative;
    border: 2px solid #f3f4f6;
    margin: 0.25rem 0;
}

.tool-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
    border-color: transparent;
}

.tool-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.tool-btn::after {
    /* Tooltip content handled by title attr natively, but could be custom CSS */
}

/* Content Blocks */
.content-block {
    position: relative;
    margin-bottom: 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.content-block:hover {
    border-color: rgba(0, 0, 0, 0.05);
}

.content-block:focus-within {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(224, 170, 255, 0.1);
}

/* Typography Blocks */
.block-h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.8rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    outline: none;
}

.block-p {
    font-size: 1.15rem;
    line-height: 1.75;
    color: #333;
    margin-bottom: 0.8rem;
    outline: none;
}

.block-ul {
    padding-left: 1.5rem;
    color: #333;
    font-size: 1.1rem;
    line-height: 1.7;
    outline: none;
}

/* Rich Blocks */
.block-quote {
    border-left: 5px solid var(--primary-color);
    padding: 1.2rem 2rem;
    color: #444;
    font-size: 1.2rem;
    font-style: italic;
    background: #fdfdfd;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
    outline: none;
}

.block-code {
    background: #282c34;
    color: #abb2bf;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    outline: none;
}

.block-callout {
    background: #fff8e1;
    border-left: 5px solid #ffc107;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: start;
}

.block-callout i {
    font-size: 1.5rem;
    color: #ffca28;
    margin-top: 0.2rem;
}

.block-image {
    width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.block-video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.block-file {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.block-file:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.1);
    color: var(--primary-color);
}

/* General UI Components */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

/* Button styles consolidated at top of file */

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    border: 2px solid #f0f2f5;
    background: #f8f9fa;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(224, 170, 255, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Footer */
/* Footer - Modern & Sleek */
.footer {
    background: #ffffff;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-color);
    font-size: 0.95rem;
    position: relative;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.02);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: left;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.footer-logo {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    display: inline-block;
    text-decoration: none;
}

.footer-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-contact-item i {
    color: var(--primary-color);
    margin-top: 0.3rem;
    font-size: 1.1rem;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}


/* Module Add Button */
.module-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f3f5;
    color: var(--text-muted);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.module-add-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.module-add-btn i {
    font-size: 0.9rem;
}

/* Navbar Enhancements */
.navbar-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    width: 25px;
    padding: 0;
    z-index: 1100;
}

.navbar-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.user-menu-mobile {
    display: contents;
    /* Default for desktop */
}

.auth-buttons-mobile {
    display: contents;
    /* Default for desktop */
}

/* Mobile Responsive Styles - Polished */
@media (max-width: 900px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .navbar-toggle {
        display: flex;
    }

    /* Close button removed as requested, using backdrop instead */
    .nav-mobile-header {
        display: none !important;
    }

    .navbar-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        /* Revert to partial width so backdrop is visible */
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 5rem 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 1.5rem;
        z-index: 1000;
        overflow-y: auto;
        visibility: hidden;
    }

    .navbar-nav.active {
        right: 0;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        /* Slightly stronger shadow */
        visibility: visible;
    }

    /* Dedicated Backdrop */
    .navbar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        /* Semi-transparent black */
        z-index: 990;
        /* Behind navbar-nav (1000) but above content */
        backdrop-filter: blur(3px);
        /* Glassmorphism effect */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .navbar-backdrop.active {
        display: block;
        opacity: 1;
    }

    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-link:hover {
        padding-left: 10px;
        /* Slight movement on hover */
    }

    .user-menu-mobile,
    .auth-buttons-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        margin-top: 1rem;
    }

    .btn-sm-mobile {
        width: 100%;
        justify-content: center;
        margin: 0 !important;
    }

    /* Container Spacing */
    .container {
        padding: 0 1.2rem;
        margin: 1.5rem auto;
    }

    /* Typography Scaling */
    h1 {
        font-size: 1.8rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Dashboard Header */
    .dashboard-header-modern {
        padding: 2rem 1.5rem;
        border-radius: 12px;
        text-align: left;
    }

    .dashboard-header-modern i {
        opacity: 0.05;
        font-size: 6rem;
        bottom: -10px;
        right: -10px;
    }

    /* Cards */
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .course-card {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    }

    .card {
        padding: 1.5rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    /* Editor Adjustments */
    .full-screen-editor {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #eee;
        position: relative;
        overflow-y: auto;
    }

    .editor-tools {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 1rem;
        border-left: none;
        border-top: 1px solid #eee;
        order: 3;
        justify-content: flex-start;
    }

    .editor-canvas {
        flex-grow: 1;
        overflow-y: auto;
        padding-bottom: 80px;
    }

    .editor-page {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
        width: 95%;
        min-height: 60vh;
    }

    /* Learning View Mobile Optimizations */
    .learn-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        /* Allow scroll on body for mobile if needed, or maintain fixed */
        height: 100vh;
        overflow: hidden;
    }

    .learn-layout .sidebar {
        width: 100%;
        height: auto;
        max-height: 25vh;
        border-right: none;
        border-bottom: 1px solid #eee;
        flex-shrink: 0;
        order: 2;
        /* Move navigation to bottom or top? Top is standard for context. */
        order: 1;
    }

    .learn-layout .content-area {
        width: 100%;
        padding: 1.5rem;
        flex-grow: 1;
        overflow-y: auto;
        order: 2;
        border-radius: 0;
        box-shadow: none;
    }
}



.love-note {
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(to right, rgba(106, 17, 203, 0.05), rgba(37, 117, 252, 0.05));
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.brand-text {
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
    position: relative;
}

.brand-text::after {
    content: '✨';
    font-size: 0.8em;
    position: absolute;
    top: -5px;
    right: -12px;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}



/* Legal Page Styles */
.legal-page {
    padding: 3rem 0;
}

.legal-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.legal-header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.legal-header .subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.legal-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.9rem 1.8rem;
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

.org-details p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
}

.org-details p strong {
    color: var(--text-color);
    font-weight: 600;
}

.org-details p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Legal Content Body Styles */
.legal-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.legal-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.legal-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1.05rem;
}

.legal-content .text-muted {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: block;
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.legal-content a:hover {
    text-decoration: underline;
}



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Layout for Teachers/Admins - UntitledUI Style */
.app-layout {
    display: flex;
    min-height: 100vh;
}


/* --- New Dashboard Layout (Flowbite-inspired) --- */

/* Top Navbar */
.flow-navbar {
    position: fixed;
    top: 0;
    z-index: 50;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.flow-navbar-container {
    padding: 0.5rem 1rem;
}

.flow-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flow-nav-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.flow-hamburger {
    display: none;
    /* Hidden by default (desktop) */
    align-items: center;
    padding: 0.5rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.flow-hamburger:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.flow-brand {
    display: flex;
    margin-left: 0.5rem;
    margin-right: 1.5rem;
    align-items: center;
    text-decoration: none;
}

.flow-brand img {
    height: 2rem;
    margin-right: 0.75rem;
}

.flow-brand-text {
    align-self: center;
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    color: #111827;
}

.flow-user-menu-btn {
    display: flex;
    align-items: center;
    background-color: #1f2937;
    border-radius: 9999px;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: ring 0.2s;
}

.flow-user-menu-btn:focus {
    box-shadow: 0 0 0 4px #e5e7eb;
}

.flow-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    object-fit: cover;
}

.flow-user-avatar-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* User Dropdown */
.flow-user-dropdown {
    position: absolute;
    top: 50px;
    right: 1rem;
    z-index: 50;
    display: none;
    /* Hidden by default */
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 12rem;
    list-style: none;
    padding: 0;
    text-align: left;
}

.flow-user-dropdown.show {
    display: block;
}

.flow-user-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.flow-user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

.flow-user-email {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
}

.flow-dropdown-item:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Sidebar */
.flow-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: 16rem;
    /* 64 * 0.25rem = 16rem = 256px */
    height: 100vh;
    padding-top: 3.5rem;
    /* Space for top navbar (14 * 0.25rem = 3.5rem) */
    transition: transform 0.3s ease-in-out;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    transform: translateX(0);
    /* Default desktop: visible */
}

.flow-sidebar-inner {
    height: 100%;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    background-color: #ffffff;
}

.flow-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flow-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    /* p-2 */
    color: #111827;
    /* text-gray-900 */
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    group: true;
}

.flow-nav-item:hover {
    background-color: #f3f4f6;
}

.flow-nav-item.active {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

.flow-nav-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    transition: color 0.1s;
}

.flow-nav-item:hover .flow-nav-icon,
.flow-nav-item.active .flow-nav-icon {
    color: var(--primary-color);
}

.flow-nav-label {
    flex: 1;
    margin-left: 0.75rem;
    white-space: nowrap;
}

.flow-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    margin-left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    background-color: #eff6ff;
    border-radius: 9999px;
}

/* Main Content */
.flow-content {
    padding: 0;
    padding-top: 4.5rem;
    /* mt-14 roughly */
    margin-left: 16rem;
    /* Shift for sidebar */
    transition: margin-left 0.3s;
    min-height: 100vh;
    background-color: #fcfcfd;
}

/* Responsive */
@media (max-width: 640px) {
    .flow-hamburger {
        display: inline-flex;
    }

    .flow-sidebar {
        transform: translateX(-100%);
        /* Hidden on mobile by default */
    }

    .flow-sidebar.open {
        transform: translateX(0);
    }

    .flow-content {
        margin-left: 0;
    }
}



/* --- Flowbite-Style Dashboard Layout --- */

.flow-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: #ffffff;
    /* Scandi Clean White */
    border-bottom: 1px solid #f1f5f9;
    /* Subtle border */
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: none;
    /* No shadow for clean look */
}

/* Dark mode adjustment for glass navbar */
.dark-mode .flow-navbar {
    background-color: #0f172a;
    border-bottom: 1px solid #1e293b;
}

.flow-navbar-container {
    width: 100%;
}

.flow-navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flow-nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flow-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flow-hamburger {
    background: transparent;
    border: none;
    color: var(--text-light);
    /* Lighter icon */
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    /* Desktop default */
}

.flow-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    /* Semi-bold */
    font-size: 1.25rem;
    gap: 0.5rem;
    color: #0f172a;
    /* Slate 900 - Strong contrast */
    letter-spacing: -0.025em;
    background: none;
    -webkit-text-fill-color: initial;
}

.dark-mode .flow-brand {
    color: #f8fafc;
}

/* Sidebar */
.flow-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 250px;
    height: calc(100vh - 64px);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 40;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.flow-sidebar-inner {
    padding: 0.25rem 0.5rem;
    /* Почти без отступа сверху */
    height: 100%;
}

.flow-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
    /* Явно прижимаем к верху */
}

.flow-nav-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    /* Более компактные кнопки */
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    /* Уменьшил отступ между кнопками */
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.flow-nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(4px);
}

.flow-nav-item.active {
    background-color: rgba(79, 70, 229, 0.08);
    /* Primary color low opacity */
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary-color);
    /* Left border accent inside */
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    /* Flat left side */
}

.flow-nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1.25rem;
    margin-right: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-nav-item:hover .flow-nav-icon,
.flow-nav-item.active .flow-nav-icon {
    color: var(--primary-color);
}

/* Content Wrapper - Fixes Layout Spacing */
.flow-content {
    margin-top: 64px;
    margin-left: 250px;
    /* Sidebar width */
    padding: 3rem;
    /* Spacious padding */
    min-height: calc(100vh - 64px);
    background-color: var(--bg-body);
}

/* User Dropdown */
.flow-user-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.flow-user-avatar-placeholder {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.flow-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 220px;
    display: none;
    z-index: 100;
    margin-top: 0.5rem;
}

.flow-user-dropdown.show {
    display: block;
}

.flow-user-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.flow-user-name {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.flow-user-email {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.flow-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.flow-dropdown-item:hover {
    background-color: var(--bg-secondary);
}

/* Mobile Adjustments */
@media (max-width: 1024px) {

    /* Tablet and smaller */
    .flow-hamburger {
        display: inline-flex;
    }

    .flow-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .flow-sidebar.open {
        transform: translateX(0);
    }

    .flow-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* --- Admin Panel & Dashboard Global Styles --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-dashboard {
    padding: 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(5deg);
}

.stat-info h3 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-color);
}

.stat-info p {
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

.stat-link {
    margin-top: auto;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-link:hover {
    text-decoration: underline;
}

/* Admin Sections & Cards */
.admin-sections {
    display: grid;
    gap: 3rem;
}

.section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.08);
}

/* Tables - Premium Style */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    color: var(--text-color);
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    position: sticky;
    top: 0;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table td {
    font-weight: 500;
    color: var(--text-color);
}

/* Page Header & Global Admin Improvements */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    animation: fadeInUp 0.4s ease-out;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

/* Button Micro-interactions */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

/* Form Controls Focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    outline: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.dark-mode .badge-primary {
    background: rgba(var(--primary-rgb), 0.2);
}

.badge-secondary {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.badge-success {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success-color);
}

.dark-mode .badge-success {
    background: rgba(var(--success-rgb), 0.2);
}

.badge-warning {
    background: rgba(var(--warning-rgb), 0.1);
    color: var(--warning-color);
}

.dark-mode .badge-warning {
    background: rgba(var(--warning-rgb), 0.2);
}

.badge-danger {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger-color);
}

.dark-mode .badge-danger {
    background: rgba(var(--danger-rgb), 0.2);
}

/* Settings Forms */
.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.settings-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* Settings form buttons inherit global styles */

/* Checkbox Toggle Switch (common in admins) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}
/* --- NEWS STYLES --- */

.news-container {
    padding: 3rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.news-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-image-wrapper {
    overflow: hidden;
    position: relative;
}

.news-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 3rem;
}

.news-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-preview {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.news-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.news-link:hover {
    gap: 0.8rem;
}

/* Single News View */
.news-detail-container {
    max-width: 900px;
    margin: 3rem auto;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.news-detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.news-detail-content {
    padding: 4rem 5rem;
}

@media (max-width: 768px) {
    .news-detail-content {
        padding: 2rem;
    }
}

.news-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.news-detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.news-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.news-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.news-body p {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    margin-top: 3rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

/* Create/Edit Form */
.news-form-container {
    max-width: 800px;
    margin: 3rem auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}


/* Mobile Responsiveness & Fixes */
.news-body {
    word-break: break-word;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .news-container {
        padding: 1.5rem 1rem;
    }

    .news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .news-title {
        font-size: 2rem;
    }
    
    .news-detail-container {
        margin: 1rem 0.5rem;
        width: auto;
        border-radius: 16px;
    }

    .news-detail-content {
        padding: 1.5rem;
    }

    .news-detail-title {
        font-size: 1.75rem;
    }

    .news-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
}


/* Perception Alignment Fixes */
.news-header {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 1.5rem;
}

.news-content {
    text-align: center; /* Center text */
    align-items: center; /* Center flex items (if direction is column) */
}

.news-date {
    justify-content: center; /* Center icon and date */
    width: 100%;
}

.news-item-title {
    text-align: center;
}

.news-preview {
    text-align: center;
}

/* Center the buttons at the bottom */
.news-content > div:last-child {
    justify-content: center !important;
    width: 100%;
    gap: 1rem;
}


/* Fix Alignment: Center Grid, Left Align Text */
.news-grid {
    justify-content: center;
}

.news-content {
    text-align: left;
    align-items: stretch;
}

.news-item-title, .news-preview {
    text-align: left;
}

.news-date {
    justify-content: flex-start;
}

/* Restore button alignment */
.news-content > div:last-child {
    justify-content: space-between !important;
}

/* Ensure header is standard */
.news-header {
    justify-content: space-between;
    text-align: left;
    flex-direction: row;
}

/* Mobile specific for header */
@media (max-width: 768px) {
    .news-header {
        flex-direction: column;
        align-items: center; /* Center header items on mobile */
        text-align: center;
    }
}


/* Enforce ellipsis and word breaking */
.news-preview {
    word-break: break-word;
    overflow-wrap: break-word;
    /* Ensure line clamp works with long words */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item-title {
    word-break: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* About Page Styles */
.about-hero {
    text-align: center;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.about-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.about-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-description {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.about-version {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 50px;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 4rem;
    border: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    color: var(--primary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-text {
    color: var(--text-muted);
    line-height: 1.6;
}

.team-section {
    margin-top: 8rem;
    text-align: center;
}

.developer-card {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    padding: 1rem 2rem 1rem 1rem;
    border-radius: 100px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.dev-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e5e7eb;
    overflow: hidden;
}

.dev-info {
    text-align: left;
}

.dev-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.dev-role {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}


/* Enhanced Developer Card */
.team-section {
    margin-top: 6rem;
    position: relative;
    padding: 3rem 0;
}

.developer-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

.developer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
}

.developer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.dev-avatar {
    width: 100px; /* Increased size */
    height: 100px;
    margin-bottom: 1.5rem;
    border: 4px solid white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.dev-info {
    text-align: center; /* Center text */
    margin-bottom: 1.5rem;
}

.dev-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.dev-role {
    font-size: 1rem;
    padding: 0.25rem 1rem;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 50px;
    display: inline-block;
}

/* GitHub Icon as a button */
.developer-card a {
    margin-left: 0 !important;
    background: #24292f;
    color: white !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem !important;
    transition: all 0.3s ease;
}

.developer-card a:hover {
    transform: rotate(360deg) scale(1.1);
    background: black;
}


/* Increase spacing between team cards */
.team-grid {
    gap: 5rem !important; /* Force larger gap */
    padding: 0 2rem;
}

.developer-card {
    margin: 1rem; /* Add external margin as safety buffer */
}


/* Center Team Grid Strictly */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure individual cards don't push themselves */
.developer-card {
    margin-left: 2rem !important;
    margin-right: 2rem !important;
}

