/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Premium Palette */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-color-dark: #4338ca;
    --secondary-color: #06b6d4;
    /* Cyan 500 */
    --accent-color: #ec4899;
    /* Pink 500 */
    --text-color: #0f172a;
    /* Slate 900 */
    --text-color-rgb: 15, 23, 42;
    --light-text: #64748b;
    /* Slate 500 */
    --background: #f8fafc;
    /* Slate 50 */
    --light-background: #f1f5f9;
    /* Slate 100 */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --card-background: #ffffff;
    --card-background-rgb: 255, 255, 255;
    --shadow-color: rgba(15, 23, 42, 0.08);
    --shadow-hover: rgba(15, 23, 42, 0.12);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-height: 80px;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-color-dark: #4f46e5;
    --secondary-color: #22d3ee;
    /* Cyan 400 */
    --accent-color: #f472b6;
    /* Pink 400 */
    --text-color: #f8fafc;
    /* Slate 50 */
    --text-color-rgb: 248, 250, 252;
    --light-text: #94a3b8;
    /* Slate 400 */
    --background: #0f172a;
    /* Slate 900 */
    --light-background: #1e293b;
    /* Slate 800 */
    --border-color: #334155;
    /* Slate 700 */
    --card-background: #1e293b;
    --card-background-rgb: 30, 41, 59;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    transition: background-color 0.4s ease, color 0.4s ease;
    padding-top: var(--navbar-height);
    /* Account for fixed navbar */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glassmorphism Utilities */
.glass-effect {
    background: rgba(var(--card-background-rgb), 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--text-color-rgb), 0.08);
}

/* Skip to main content - accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0.5rem;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 0.25rem;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0.5rem;
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Visibility Utilities - CSP Compliant */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-block { display: inline-block !important; }
.d-inline { display: inline !important; }
.v-hidden { visibility: hidden !important; }
.v-visible { visibility: visible !important; }

/* Spacing and Typography Helpers */
.m-16-0 { margin: 16px 0 !important; }
.m-t-4 { margin-top: 4px !important; }
.m-t-10 { margin-top: 10px !important; }
.m-t-16 { margin-top: 16px !important; }
.m-t-100-auto { margin: 100px auto !important; }
.m-t-2rem { margin-top: 2rem !important; }
.m-32-0 { margin: 32px 0 !important; }
.m-b-8 { margin-bottom: 8px !important; }
.m-b-12 { margin-bottom: 12px !important; }
.m-b-12 { margin-bottom: 12px !important; }
.m-b-16 { margin-bottom: 16px !important; }
.m-b-24 { margin-bottom: 24px !important; }
.m-b-32 { margin-bottom: 32px !important; }
.m-0-auto-24 { margin: 0 auto 24px !important; }
.m-l-10 { margin-left: 10px !important; }
.m-v-32 { margin: 32px 0 !important; }
.m-b-24 { margin-bottom: 24px !important; }
.m-b-32 { margin-bottom: 32px !important; }
.p-16 { padding: 16px !important; }
.p-l-10 { padding-left: 10px !important; }
.p-40 { padding: 40px !important; }
.p-40-20 { padding: 40px 20px !important; }
.p-8-24 { padding: 8px 24px !important; }
.p-2-6 { padding: 2px 6px !important; }
.p-10-24 { padding: 10px 24px !important; }
.min-h-0 { min-height: 0 !important; }
.min-h-42 { min-height: 42px !important; }
.w-80 { width: 80% !important; }
.w-100 { width: 100% !important; }
.w-200-max { width: 100%; max-width: 200px !important; }
.w-100-max-600 { width: 100%; max-width: 600px !important; }
.w-100-max-450 { width: 100%; max-width: 450px !important; }
.flex-1 { flex: 1 !important; }
.text-center { text-align: center !important; }
.text-none { text-decoration: none !important; }
.cursor-default { cursor: default !important; }
.cursor-pointer { cursor: pointer !important; }
.o-05 { opacity: 0.5 !important; }
.o-08 { opacity: 0.8 !important; }
.fs-64 { font-size: 64px !important; }
.fs-3rem { font-size: 3rem !important; }
.fs-3-5rem { font-size: 3.5rem !important; }
.fs-2-2rem { font-size: 2.2rem !important; }
.fs-1-5 { font-size: 1.5rem !important; }
.fs-1-1 { font-size: 1.1rem !important; }
.fs-1-1rem { font-size: 1.1rem !important; }
.fs-0-9 { font-size: 0.9rem !important; }
.fs-0-8 { font-size: 0.8rem !important; }
.fs-0-75 { font-size: 0.75rem !important; }
.lh-1-6 { line-height: 1.6 !important; }
.fw-bold { font-weight: bold !important; }
.f-italic { font-style: italic !important; }
.td-none { text-decoration: none !important; }
.gap-4 { gap: 4px !important; }
.gap-8 { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.ai-center { align-items: center !important; }
.jc-center { justify-content: center !important; }
.cursor-pointer { cursor: pointer !important; }
.bg-none { background: none !important; }
.b-none { border: none !important; }
.br-8 { border-radius: 8px !important; }
.br-6 { border-radius: 6px !important; }
.br-12 { border-radius: 12px !important; }
.b-none { border: none !important; }
.b-t-1-white-1 { border-top: 1px solid rgba(255,255,255,0.1) !important; }
.b-l-3-warning { border-left: 3px solid #f59e0b !important; }
.b-1-warning { border: 1px solid #f59e0b !important; }
.b-1-white-1 { border: 1px solid rgba(255,255,255,0.1) !important; }
.b-1-white-05 { border: 1px solid rgba(255,255,255,0.05) !important; }
.us-all { user-select: all !important; }
.bg-muted { background: var(--bg-muted, #1a1a1a) !important; }
.bg-warning-008 { background: rgba(245,158,11,0.08) !important; }
.bg-warning-005 { background: rgba(245,158,11,0.05) !important; }
.primary-color { color: var(--primary-color) !important; }
.border-color { color: var(--border-color) !important; }
.success-color { color: var(--success-color) !important; }
.text-success { color: #10b981 !important; }
.text-danger { color: #dc2626 !important; }
.text-warning { color: #f59e0b !important; }
.text-muted { color: var(--light-text) !important; }

.anim-fade-in-up { animation: fadeInUp 0.4s ease forwards !important; }

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

/* Co-author Pill Styles - Moved from JS for CSP compliance */
.coauthor-pill {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(var(--card-background-rgb), 0.05);
    border-radius: 8px;
    align-items: center;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.coauthor-pill.is-pending {
    opacity: 0.8;
}

.coauthor-pill-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.coauthor-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}

.coauthor-pill.is-pending .coauthor-pill-avatar {
    background: var(--light-text);
}

.coauthor-pill-info {
    display: flex;
    flex-direction: column;
}

.coauthor-pill-name {
    font-weight: 500;
}

.coauthor-pill-status {
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
}

.coauthor-pill-remove {
    color: var(--danger-color);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.coauthor-pill-remove:hover {
    transform: scale(1.1);
}

/* Mention Dropdown Styles - Moved from JS for CSP compliance */
.mention-dropdown {
    position: absolute;
    top: var(--dropdown-top, 0);
    left: var(--dropdown-left, 0);
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
}

/* Skeleton loaders */
.skeleton-line {
    height: 1rem;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--light-background) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.4rem;
    width: 70%;
}

.skeleton-text {
    height: 0.875rem;
    width: 100%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.loading-logo {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: bounce 1.5s ease-in-out infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: var(--text-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Navbar Transitions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide auth elements during loading with smooth transitions */
.auth-loading .auth-buttons,
.auth-loading .user-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Show auth elements when loading is complete with smooth animations */
.auth-loaded .auth-buttons.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-loaded .user-menu {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-buttons {
    display: flex;
    /* Show by default */
    gap: 0.5rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.auth-buttons.hide {
    display: none;
    /* Hide only when explicitly hidden */
    opacity: 0;
    transform: translateY(-10px);
}

/* User Menu Transitions */
.user-menu {
    display: none;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* User Menu - Show when explicitly told by JS */
.user-menu.show {
    display: flex;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
}

.user-menu.show .notification-bell {
    margin-right: 1rem;
}

.admin-only, .contributor-only, .d-none, .hide {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Search icon (top right, next to notifications) */
.nav-icon-link.nav-search {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-icon-link.nav-search:hover {
    background-color: var(--light-background);
    color: var(--primary-color);
}

.nav-icon-link.nav-search i {
    font-size: 1.2rem;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

.notification-bell:hover {
    background-color: var(--light-background);
}

.notification-bell i {
    font-size: 1.2rem;
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1000;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

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

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.notification-item:hover {
    background-color: var(--light-background);
}

.notification-item.unread {
    background-color: rgba(37, 99, 235, 0.05);
}

.notification-item.unread:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.notification-message {
    color: var(--light-text);
    font-size: 0.8rem;
    line-height: 1.4;
}

.notification-time {
    color: var(--light-text);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: var(--light-text);
    font-style: italic;
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.notification-empty p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.notification-empty small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mark-all-read,
.view-all-notifications {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.mark-all-read:hover,
.view-all-notifications:hover {
    background-color: var(--light-background);
}

.notification-more {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--light-background);
}

.notification-more p {
    margin: 0 0 0.5rem 0;
    color: var(--light-text);
    font-size: 0.9rem;
}

.notification-more .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Mention System Styles */
.mention {
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mention:hover {
    background: var(--primary-color-dark, #0056b3);
    color: white;
}

.mention-dropdown {
    position: absolute;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
}

.mention-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.mention-option:last-child {
    border-bottom: none;
}

.mention-option:hover,
.mention-option.highlighted {
    background: var(--light-background);
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--light-background);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mention-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.mention-avatar i {
    color: var(--light-text);
    font-size: 0.9rem;
}

.mention-info {
    flex: 1;
    min-width: 0;
}

.mention-username {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.mention-name {
    color: var(--light-text);
    font-size: 0.8rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Co-Author Autocomplete Styles */
.coauthor-autocomplete-wrapper {
    position: relative;
    flex: 1;
}

.coauthor-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
}

.coauthor-autocomplete-results.show {
    display: block;
}

.coauthor-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

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

.coauthor-result-item:hover,
.coauthor-result-item.highlighted {
    background-color: var(--light-background);
    color: var(--primary-color);
}

.coauthor-result-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--light-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--light-text);
    overflow: hidden;
}

.coauthor-result-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.coauthor-result-displayname {
    font-weight: 600;
    font-size: 0.9rem;
}

.coauthor-result-username {
    font-size: 0.75rem;
    opacity: 0.7;
}

.coauthor-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--light-text);
    font-size: 0.85rem;
    font-style: italic;
}

.user-menu-toggle {
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    opacity: 1;
    transform: translateY(0);
}

.user-menu-toggle:hover {
    background: var(--light-background);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(var(--card-background-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(var(--text-color-rgb), 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

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

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

/* Keep brand text style consistent across all pages/states */
#siteLogo,
#siteLogo:link,
#siteLogo:visited,
#siteLogo:hover,
#siteLogo:active,
.navbar .logo,
.navbar .logo:link,
.navbar .logo:visited,
.navbar .logo:hover,
.navbar .logo:active {
    text-decoration: none !important;
    font-size: 2.1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Floating theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1000;
    width: 3.5rem;
    height: 3.5rem;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    background: none;
    border: none;
    padding: 0.5rem;
    transition: var(--transition);
}

.menu-toggle i {
    font-size: inherit;
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hide auth elements during loading */
.auth-loading .auth-buttons,
.auth-loading .user-menu {
    display: none !important;
}

/* Show auth elements when loading is complete */
.auth-loaded .auth-buttons.show {
    display: flex !important;
}

/* User menu should only show when user is authenticated */
.auth-loaded .user-menu.show {
    display: flex !important;
    align-items: center !important;
}

.auth-loaded .user-menu:not(.show) {
    display: none !important;
}

.auth-buttons {
    display: none;
    /* Hide by default */
    gap: 0.5rem;
}

.auth-buttons.show {
    display: flex;
    /* Show only when explicitly shown */
}

.btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 9999px;
    /* Pill shape for modern look */
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease-out;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(1);
    transition: 0s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

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

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

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

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

/* User Menu */
.user-menu {
    display: none;
    position: relative;
    align-items: center;
    gap: 0.75rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-bell:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.notification-bell i {
    font-size: 1.2rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-color, #ef4444);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(var(--text-color-rgb), 0.04);
    border: 1px solid rgba(var(--text-color-rgb), 0.08);
    color: var(--text-color);
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: 99px;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: rgba(var(--text-color-rgb), 0.08);
    border-color: rgba(var(--text-color-rgb), 0.15);
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-toggle i.fa-chevron-down {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-right: 4px;
}

/* User Menu Dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.user-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    background: var(--card-background);
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

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

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--light-text);
}

.admin-only {
    display: none;
}

.dropdown-item.admin-only {
    color: var(--primary-color);
    font-weight: 500;
}

.dropdown-item.admin-only:hover {
    background: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('https://images.unsplash.com/photo-1499750310107-5fef28a66643');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 4rem;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: var(--transition);
    min-height: 44px;
    /* Touch-friendly minimum size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Featured Posts */
.featured-posts {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.featured-posts h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-background);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px var(--shadow-color);
}

.post-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.post-content {
    padding: 1.5rem;
}

.category {
    display: inline-block;
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

.post-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.post-content p {
    color: var(--light-text);
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* Blog Page */
.page-header {
    background-color: var(--light-background);
    padding: 6rem 1rem 3rem;
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.blog-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.pagination {
    text-align: center;
    margin-bottom: 3rem;
}

.load-more {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.load-more:hover {
    background-color: var(--secondary-color);
}

/* About Page */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.team-section {
    text-align: center;
    margin-bottom: 4rem;
}

.team-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.team-member h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.team-member p {
    color: var(--light-text);
}

/* Contact Page */
.contact-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.contact-info {
    background-color: var(--light-background);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.contact-info h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: var(--text-color);
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 100%;
    background-color: var(--card-background);
    color: var(--text-color);
    transition: var(--transition);
    font-size: 16px;
    /* Prevents zoom on iOS */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.footer {
    background-color: var(--light-background);
    padding: 4rem 1rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--light-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 72px;
        /* Enough clearance for fixed navbar on mobile */
    }

    .main-content {
        padding-top: 0.5rem;
    }

    /* Navigation */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--background);
        padding: 1rem 1.5rem;
        box-shadow: 0 4px 12px var(--shadow-color);
        border: 1px solid var(--border-color);
        border-top: none;
        z-index: 999;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-links {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        position: static;
    }

    .nav-menu .nav-links a {
        font-size: 1.1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-menu .nav-actions {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu .user-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-menu .user-menu-toggle {
        justify-content: flex-start;
    }

    .mobile-auth-item {
        display: block;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .mobile-auth-item .auth-buttons {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-auth-item .auth-buttons.show {
        display: flex;
    }

    .mobile-auth-item .btn {
        width: 100%;
        justify-content: center;
    }

    /* Hero Section */
    .hero {
        height: 70vh;
        margin-top: 3.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }

    .hero-content {
        padding: 1.5rem;
    }

    /* Featured Posts */
    .featured-posts {
        margin: 3rem auto;
        padding: 0 1.5rem;
    }

    .featured-posts h2 {
        font-size: 1.8rem;
        margin-bottom: 2.5rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-card {
        margin: 0;
    }

    .post-content {
        padding: 1.25rem;
    }

    .post-content h3 {
        font-size: 1.2rem;
    }

    /* Blog Page */
    .page-header {
        padding: 5rem 1.5rem 2.5rem;
        margin-bottom: 2rem;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .blog-content {
        padding: 0 1.5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* About Page */
    .about-content {
        padding: 0 1.5rem;
    }

    .about-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }

    .about-text h2 {
        font-size: 1.8rem;
    }

    .team-section h2 {
        font-size: 1.8rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Contact Page */
    .contact-content {
        padding: 0 1.5rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 3rem;
    }

    .contact-info {
        padding: 1.5rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 1.5rem 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    /* Theme Toggle */
    .theme-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }

    /* Blog Post Responsive */
    .blog-post-container {
        padding: 1rem 0;
    }

    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {

    /* Navigation */
    .nav-content {
        padding: 0.75rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* Hero Section */
    .hero {
        height: 60vh;
        margin-top: 3rem;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-content {
        padding: 1rem;
    }

    /* Featured Posts */
    .featured-posts {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .featured-posts h2 {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .post-card {
        margin: 0;
    }

    .post-image {
        height: 180px;
    }

    .post-content {
        padding: 1rem;
    }

    .post-content h3 {
        font-size: 1.1rem;
    }

    /* Blog Page */
    .page-header {
        padding: 4rem 1rem 2rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .blog-content {
        padding: 0 1rem;
    }

    /* About Page */
    .about-content {
        padding: 0 1rem;
    }

    .about-section {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .about-text h2 {
        font-size: 1.6rem;
    }

    .team-section h2 {
        font-size: 1.6rem;
    }

    .team-member img {
        width: 120px;
        height: 120px;
    }

    /* Contact Page */
    .contact-content {
        padding: 0 1rem;
    }

    .contact-container {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .contact-info {
        padding: 1.25rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem 1.5rem;
    }

    /* Theme Toggle */
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }

    /* Blog Post Responsive */
    .blog-post-container {
        padding: 0.5rem 0;
    }

    .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .blog-post-footer .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .featured-posts h2 {
        font-size: 1.4rem;
    }

    .post-content h3 {
        font-size: 1rem;
    }

    .theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8rem;
    }
}

/* Desktop styles - hide mobile auth buttons */
@media (min-width: 769px) {
    .mobile-auth-item {
        display: none !important;
    }
}

/* Position notification dropdown relative to the user menu */
.user-menu .notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow-color);
    margin-top: 12px;
    z-index: 2000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--text-color-rgb), 0.02);
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.notification-actions {
    display: flex;
    gap: 0.75rem;
}

.notification-actions button {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.notification-actions button:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    transform: translateY(-1px);
}

.notification-actions button#viewAllBtn {
    background: var(--primary-color);
    color: white;
}

.notification-actions button#viewAllBtn:hover {
    background: var(--secondary-color);
    box-shadow: 0 4px 10px rgba(var(--primary-color-rgb), 0.2);
}

/* Notification Items in Dropdown */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--card-background);
}

.notification-item:hover {
    background: rgba(var(--text-color-rgb), 0.03);
}

.notification-item.unread {
    background: rgba(var(--primary-color-rgb), 0.04);
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

.notification-content {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.notification-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--text-color-rgb), 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.15rem;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--light-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--light-text);
    opacity: 0.7;
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--light-text);
}

.notification-empty i {
    font-size: 2rem;
    opacity: 0.2;
    margin-bottom: 1rem;
    display: block;
}

.notification-empty p {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-empty small {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Breadcrumb Navigation */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.breadcrumb span {
    color: var(--text-color);
    font-weight: 500;
}

/* Blog Post Container */
.blog-post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.blog-post-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.blog-post-footer .btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Site announcements banner */
#announcements-banner-container {
    position: relative;
    z-index: 999;
}

.announcement-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.announcement-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.announcement-banner-content strong {
    margin-right: 0.25rem;
}

.announcement-banner-dismiss {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
    padding: 0 0.25rem;
}

.announcement-banner-dismiss:hover {
    opacity: 1;
}

/* Shared emoji picker popover */
.emoji-picker-popover {
    position: absolute;
    z-index: 4500;
    display: block;
    width: min(360px, 94vw);
    max-height: 360px;
    overflow: hidden;
    padding: 0.45rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(var(--card-background-rgb), 0.97), var(--card-background));
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.25), 0 6px 16px rgba(2, 6, 23, 0.2);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.22rem;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-height: 290px;
    overflow-y: auto;
}

.emoji-picker-grid .emoji-picker-btn {
    margin: 0.1rem;
}

.emoji-picker-btn {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 0.6rem;
    padding: 0.4rem 0.3rem;
    font-size: 1.12rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.emoji-picker-btn:hover {
    background: var(--light-background);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.emoji-picker-host {
    position: relative;
}

.emoji-picker-host .emoji-picker-popover {
    top: calc(100% + 8px);
    left: 0;
}

.emoji-toolbar-btn {
    min-width: 32px;
    min-height: 28px;
    border-radius: 0.45rem;
    line-height: 1;
}

.emoji-toolbar-btn:hover {
    background: var(--light-background);
}

.emoji-toolbar-btn-active {
    background: rgba(79, 70, 229, 0.14);
    border-color: rgba(79, 70, 229, 0.35);
}

/* Cookie consent banner (CSP-safe: stylesheet only, no injected <style>) */
.cookie-consent {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 9999;
    max-width: 320px;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--card-background, #1f2937);
    color: var(--text-color, #f9fafb);
    box-shadow: 0 8px 32px var(--shadow-color, rgba(0,0,0,.25)), 0 0 0 1px var(--border-color, rgba(255,255,255,.08));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-consent.cookie-consent--hidden {
    transform: translate(-120%, 0);
    opacity: 0;
}

.cookie-consent__inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-consent__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.cookie-consent__text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-color);
}

.cookie-consent__text strong {
    font-weight: 600;
}

.cookie-consent__links {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
}

.cookie-consent__links a {
    color: var(--primary-color, #3b82f6);
    text-decoration: underline;
}

.cookie-consent__links a:hover {
    text-decoration: none;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cookie-consent__btn {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.cookie-consent__btn:hover {
    opacity: 0.9;
}

.cookie-consent__btn--primary {
    background: var(--primary-color, #3b82f6);
    color: #fff;
}

.cookie-consent__btn--secondary {
    background: var(--border-color, #374151);
    color: var(--text-color);
}

/* Toast/confirm animations (moved from runtime style injection for CSP) */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Toast System Styles - Moved from JS for CSP compliance */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-warning { background: #f59e0b; }
.toast-info { background: #3b82f6; }

.toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: toastConfirmFadeIn 0.2s ease-out;
}

.toast-confirm-modal {
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: toastConfirmSlideUp 0.25s ease-out;
}

.toast-confirm-body {
    margin-bottom: 24px;
}

.toast-confirm-title {
    margin: 0 0 12px 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.toast-confirm-text {
    margin: 0;
    color: var(--light-text);
    line-height: 1.5;
    font-size: 0.9375rem;
}

.toast-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.toast-confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9375rem;
    border: none;
}

.toast-confirm-cancel {
    border: 1px solid var(--border-color);
    background: var(--light-background);
    color: var(--text-color);
}

.toast-confirm-yes {
    background: var(--primary-color);
    color: white;
}

.toast-confirm-yes.danger {
    background: var(--danger-color);
}

.toast-prompt-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 18px;
}