/* iOS Safari Compatibility Fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific fixes */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection where needed */
    p, h1, h2, h3, h4, h5, h6, span, div {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Prevent iOS Safari from zooming on input focus */
    input, textarea, select {
        font-size: 16px !important;
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    /* Fix iOS Safari viewport issues */
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Prevent iOS Safari from creating scrollable areas */
    .main-container, .main-content, .sidebar {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* Fix iOS Safari flexbox issues */
    .nav-container, .hero-stats, .category-grid {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        flex-direction: row;
    }
    
    /* Prevent iOS Safari from breaking on transforms */
    .category-card:hover, .featured-card:hover, .quick-action-btn:hover {
        -webkit-transform: translateY(-2px);
        transform: translateY(-2px);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Fix iOS Safari button issues */
    button {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
        border: none;
        outline: none;
    }
    
    /* Prevent iOS Safari from breaking on complex animations */
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ===== FINAL MOBILE OVERRIDES (ensure these two fixes always apply) ===== */
@media (max-width: 768px) {
  /* 1) Remove the pages/categories/views hero stats on mobile */
  .hero-stats { display: none !important; }

  /* 2) Make content larger and take more of the screen */
  .main-content { padding: 8px !important; border-radius: 0 !important; }
  .main-container { padding: 6px !important; gap: 10px !important; }
  .content-header { padding: 6px 8px !important; }
  .welcome-section { padding: 10px !important; }
  .welcome-card { padding: 10px !important; }
  .section-header { margin-bottom: 14px !important; padding: 0 6px !important; }
  .category-grid { gap: 10px !important; }
  .category-box { padding: 14px !important; }
  .category-box a { padding: 10px 12px !important; }
  .category-pages-grid, #category-pages-grid { gap: 12px !important; }
  .category-page-card { padding: 14px !important; }
  .page-card-body { padding: 8px !important; }
  .rich-content, .rich-content p, .rich-content li { font-size: 18px !important; line-height: 1.75 !important; }
  
  /* 3) Improve touch targets for mobile */
  .search-btn { width: 48px !important; height: 48px !important; }
  
  /* Touch target utility class */
  .touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .rich-content h1 { font-size: 34px !important; line-height: 1.2 !important; }
  .rich-content h2 { font-size: 28px !important; line-height: 1.25 !important; }
  .rich-content h3 { font-size: 24px !important; line-height: 1.3 !important; }

  /* Force list layout for dynamically rendered page cards */
  .category-pages-grid, #category-pages-grid { display: block !important; grid-template-columns: none !important; gap: 12px !important; padding-left: 0 !important; padding-right: 0 !important; }
  .category-page-card { width: 100% !important; padding: 14px !important; margin-left: 0 !important; margin-right: 0 !important; }
  .category-page-card .page-card-body { padding: 8px !important; }
  .category-page-card .page-card-description { margin-bottom: 8px !important; }
  .category-page-card .page-card-meta-row { margin-bottom: 8px !important; }
  .category-page-card .card-cta { padding: 10px !important; }

  /* Fix search input/button overlap on mobile */
  .nav-center { flex: 1 !important; }
  .search-container { max-width: 100% !important; }
  .search-input { padding: 12px 56px 12px 42px !important; font-size: 16px !important; }
  .search-icon { left: 12px !important; }

  /* Search/Popular results on mobile */
  .search-result-item { padding: 16px 14px !important; gap: 12px !important; }
  .result-icon, .result-thumb { width: 48px !important; height: 48px !important; }
  .result-thumb.result-icon { font-size: 16px !important; }
  .result-rank { width: 32px !important; height: 32px !important; font-size: 14px !important; }
  .results-page-header h1 { font-size: 24px !important; }
  .search-header { padding: 16px 18px !important; }
  .search-results-list { gap: 10px !important; }
  .result-content h3 { font-size: 16px !important; }
  .result-content p { font-size: 13px !important; -webkit-line-clamp: 2 !important; }
  .result-arrow { display: none !important; }

  /* Search suggestions dropdown on mobile */
  .search-suggestions {
    max-height: min(60vh, 280px) !important;
    top: calc(100% + 6px) !important;
  }
  .search-suggestions .suggestion-item { padding: 10px 14px !important; gap: 12px !important; }
  .search-suggestions .suggestion-thumb {
    width: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
  }
  .search-suggestions .suggestion-text .title { font-size: 14px !important; }
  .search-suggestions .suggestion-text .desc { font-size: 12px !important; }

  /* Search input vertical centering on mobile */
  .search-input { height: 44px !important; min-height: 44px !important; }

  /* Categories section when showing search/popular results */
  .categories-section { padding: 0 16px 20px !important; }
}

@media (max-width: 480px) {
  .main-container { padding: 0 !important; gap: 8px !important; }
  .main-content { padding: 0 !important; }
  .category-page-card { border-radius: 0 !important; padding: 12px !important; }
  .category-grid { gap: 8px !important; }
  .category-box { padding: 10px !important; }
  .category-box a { padding: 8px 10px !important; }
  .rich-content, .rich-content p, .rich-content li { font-size: 19px !important; line-height: 1.8 !important; }
  .rich-content h1 { font-size: 32px !important; }
}
/* Reset and Base Styles */
:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --border: #e5e7eb;
    --text: #131517;
    --muted: #6b7280;
    --accent: #ff6b35;
    --accent-2: #f7931e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .top-nav {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    .sidebar.is-open {
        padding-left: env(safe-area-inset-left);
    }
}

/* Focus visible styles for keyboard navigation */
button:focus-visible,
a:focus-visible,
.quick-action-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    pointer-events: none;
    z-index: -1;
}



/* Announcement Banner */
.announcement-banner {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    position: relative;
    z-index: 999;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.announcement-content i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.announcement-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.announcement-close i {
    font-size: 14px;
}

/* Top Navigation */
.top-nav {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}



.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 20px;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 58px 12px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    height: 48px;
    background: var(--panel);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.search-input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 16px;
    pointer-events: none;
}

.search-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.search-btn i {
    font-size: 14px;
}

/* Live search suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.search-suggestions .suggestion-item {
    display: flex;
    gap: 14px;
    padding: 12px 18px;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.search-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.is-selected {
    background: rgba(255, 107, 53, 0.08);
}

.search-suggestions .suggestion-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.search-suggestions .suggestion-thumb.has-image {
    background: var(--border);
}

.search-suggestions .suggestion-thumb.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-suggestions .suggestion-text {
    flex: 1;
    min-width: 0;
}

.search-suggestions .suggestion-text .title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.search-suggestions .suggestion-text .desc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Subtle scrollbar for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.25);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.4);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

.nav-logo i {
    color: var(--accent);
    font-size: 28px;
    filter: none;
}



.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Mobile hamburger */
.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.menu-toggle i { color: var(--accent); font-size: 18px; }



.admin-link {
    text-decoration: none;
    color: #ff6b35;
    font-weight: 600;
    padding: 12px 24px;
    border: 2px solid #ff6b35;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: rgba(255, 107, 53, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-link:hover {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}



/* Main Container */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    gap: 30px;
    min-height: calc(100vh - 140px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--panel);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

/* Off-canvas behavior */
.backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    touch-action: none;
}
.backdrop-overlay.is-visible { opacity: 1; pointer-events: auto; }

.sidebar:hover { 
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.1);
}



.sidebar-content {
    padding: 25px;
}

.sidebar-controls {
    display: flex;
    gap: 8px;
    margin: 0 0 10px 0;
}

.sidebar-ctrl-btn {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.sidebar-ctrl-btn:hover { 
    box-shadow: 0 1px 6px rgba(255, 107, 53, 0.15); 
    border-color: rgba(255,107,53,0.4); 
    background: rgba(255, 107, 53, 0.05);
}

.sidebar-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    margin-bottom: 8px;
}

.sidebar-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-section a:hover { background: #f3f4f6; color: var(--text); }

.sidebar-section a i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.quick-action-btn {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 8px;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.quick-action-btn:hover { background: #f3f4f6; transform: translateY(-1px); }

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



/* Sidebar Stats */
.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 53, 0.08);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid rgba(255, 107, 53, 0.15);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.25);
}



.stat-item i {
    color: var(--accent);
    font-size: 14px;
    width: 16px;
    text-align: center;
}



/* Category Links */
.sidebar-category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 6px;
    font-size: 13px;
}

.sidebar-category-link:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
}

.sidebar-category-link i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

/* Category Pages Design */
.category-pages-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Category toolbar */
.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 6px 0 6px;
}
.toolbar-left { display: inline-flex; align-items: center; gap: 8px; }
.toolbar-label { font-size: 12px; color: var(--muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.sort-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}
.toolbar-right { overflow-x: auto; }
.toolbar-tags { display: inline-flex; gap: 6px; padding-bottom: 6px; }
.filter-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}
.filter-chip.active { background: rgba(255,107,53,0.1); border-color: rgba(255,107,53,0.5); color: #ff6b35; font-weight: 700; }
.filter-chip.clear { background: #f9fafb; }



.category-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    height: 100%;
}

.category-page-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.page-thumb {
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #f3f4f6;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.page-thumb-sm { aspect-ratio: 3 / 2; }
.page-thumb-lg { aspect-ratio: 16 / 9; }

.page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.page-thumb-placeholder i { font-size: 22px; }

.page-card-body { padding: 14px; }

.category-page-card:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.15);
    transform: translateY(-3px);
}

.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.page-card-icon {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.page-card-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.page-views, .page-date {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-views i, .page-date i {
    color: #ff6b35;
    font-size: 10px;
}

.page-card-content {
    margin-bottom: 20px;
}

.page-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.page-card-description {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 10px 0;
    display: -webkit-box;
    line-clamp: 2; /* standard */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-card-meta-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Tag chips */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* CTA button */
.card-cta {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 6px 12px rgba(255,107,53,0.2);
}

.page-card-category {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-card-category i {
    font-size: 10px;
}

.page-card-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.page-card-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    background: var(--panel);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 0;
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.15);
}



/* Content Header */
.content-header {
    background: var(--panel);
    color: var(--text);
    padding: 0;
    border-radius: 18px 18px 0 0;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: none;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 36px 30px;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0,0,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,0,0,0.02) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hero-content h1 i {
    font-size: 48px;
    color: var(--accent);
    filter: none;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--muted);
    margin: 0 0 25px 0;
    font-weight: 400;
}

.hero-actions { display: flex; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }
.hero-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    min-height: 44px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 14px rgba(255,107,53,0.25);
}
.hero-btn i { font-size: 14px; }
.hero-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(255,107,53,0.3); }
.hero-btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.hero-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 107, 53, 0.1);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(255, 107, 53, 0.2);
}



.hero-stat i {
    font-size: 16px;
}

.hero-illustration {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.back-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    min-height: 44px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.back-btn:hover {
    transform: translateY(-1px);
}

.content-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.content-header h1 i {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.page-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.page-stats i {
    font-size: 18px;
}

.stat-number {
    font-weight: 700;
    font-size: 18px;
}

/* Welcome Section */
.welcome-section {
    padding: 30px;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s ease;
}

.welcome-card:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.1);
}

.welcome-icon {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
}

.welcome-content p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.welcome-content p:last-child {
    margin-bottom: 0;
}

/* Categories Section */
.categories-section {
    padding: 0 30px 30px 30px;
}

/* Featured strip */
.featured-section { padding: 0 30px 10px 30px; }
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    padding: 0 30px 10px;
}
.featured-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    gap: 12px;
    padding: 12px;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.featured-card { cursor: pointer; }
.featured-card:hover { border-color: rgba(255,107,53,0.4); box-shadow: 0 8px 22px rgba(255,107,53,0.15); transform: translateY(-2px); }
.featured-thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #f3f4f6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; }
.featured-body { display: grid; gap: 6px; }
.featured-title { font-weight: 800; color: var(--text); font-size: 16px; line-height: 1.2; }
.featured-desc { color: var(--muted); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px 0 30px;
    color: var(--muted);
    font-size: 14px;
}

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

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

.breadcrumb .sep {
    opacity: 0.6;
}



/* About Section */
.about-section {
    padding: 30px;
    flex: 1;
}

.about-box {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    transition: border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.about-box::before { display: none; }

.about-box:hover {
    border-color: rgba(255, 107, 53, 0.4);
}

.about-box h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-box h2 i {
    font-size: 24px;
    color: #ff6b35;
    -webkit-text-fill-color: #ff6b35;
}

/* Table of Contents */
.toc-box {
    position: sticky;
    top: 90px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}
.toc-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.toc-title .toc-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.toc-btn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 6px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.toc-box.is-collapsed .toc-list { display: none; }
.toc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.toc-list li.h2 a { font-weight: 600; }
.toc-list li.h3 { padding-left: 10px; }
.toc-list a { color: var(--muted); text-decoration: none; font-size: 13px; }
.toc-list a:hover { color: var(--accent); text-decoration: underline; }
.toc-actions .toc-btn i { font-size: 12px; color: var(--muted); }
.toc-btn:hover { border-color: rgba(255,107,53,0.4); }

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px 30px;
}

.category-box { display: none; }

.category-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.category-meta {
    display: flex;
    gap: 8px;
    margin: -6px 0 12px 0;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.meta-pill i { color: var(--accent); font-size: 12px; }

.category-box h3 i {
    font-size: 18px;
}

.category-box ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.category-box li {
    margin-bottom: 8px;
}

.category-box a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-box a:hover { background: #f3f4f6; color: var(--text); }

.category-box a i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.platform-note {
    background: rgba(255, 107, 53, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
}

.platform-note i {
    color: #ff6b35;
    font-size: 12px;
}

/* Subcategory chips on home cards */
.subcategory-header {
    margin-top: 6px;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.subcategory-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subcategory-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
}

.subcategory-chip:hover {
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.chip-icon i { color: var(--accent); font-size: 12px; }
.chip-label { font-weight: 600; }
.chip-count {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--muted);
}

/* New category cards */
.category-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    display: grid;
    gap: 10px;
    cursor: pointer;
}
.category-card:hover { border-color: rgba(255,107,53,0.35); box-shadow: 0 10px 22px rgba(255,107,53,0.12); transform: translateY(-2px); }
.category-card-header { display: flex; align-items: center; gap: 12px; }
.category-card-header .cat-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,107,53,0.1); display: inline-flex; align-items: center; justify-content: center; }
.category-card-header .cat-icon i { color: var(--accent); font-size: 16px; }
.category-card-header .cat-title { font-weight: 800; font-size: 18px; color: var(--text); }
.cat-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.cat-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-footer { display: flex; justify-content: flex-end; }
.cat-cta { background: linear-gradient(135deg, #ff6b35, #f7931e); color: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 6px 12px rgba(255,107,53,0.2); text-decoration: none; }
.cat-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(255,107,53,0.25); }

/* Subcategory list styles */
.subcategory-list {
    list-style: none;
    padding: 6px 0 0 0;
    margin: 0;
}

.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
}

.subcategory-item .left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge-pill {
    background: #f3f4f6;
    color: var(--muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
}

/* Sidebar nested lists - show tree lines for subcategories */
/* Sidebar tree visuals */
.sidebar-section ul ul { margin-left: 0; padding-left: 16px; border-left: none; position: relative; }
.sidebar-section ul ul > li { position: relative; }
.sidebar-section ul ul > li::after { /* vertical segment per item */
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.sidebar-section ul ul > li:last-child::after { /* stop at last item */
    height: 50%;
    bottom: auto;
}
.sidebar-section ul ul > li::before { /* horizontal connector */
    content: '';
    position: absolute;
    left: -12px;
    top: 18px;
    width: 12px;
    height: 2px;
    background: var(--border);
}

/* hover emphasis on connectors */
.sidebar-section ul ul > li:hover::after,
.sidebar-section ul ul > li:hover::before { background: rgba(255, 107, 53, 0.35); }

/* caret and badges */
.sidebar .has-children { display: grid; grid-template-columns: 28px 1fr; grid-auto-flow: row; align-items: start; }
.sidebar .has-children > .tree-toggle { grid-column: 1; }
.sidebar .has-children > .sidebar-category-link { grid-column: 2; }
.sidebar .has-children > ul { grid-column: 2; }
.sidebar .has-children > .tree-toggle {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 4px 0 0;
    transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
    touch-action: manipulation;
}
.sidebar .has-children > .tree-toggle, 
.sidebar .has-children > .sidebar-category-link {
    align-self: center; /* center toggle with folder icon */
}
.sidebar .has-children > .tree-toggle:hover { box-shadow: 0 1px 6px rgba(0,0,0,0.06); border-color: rgba(255,107,53,0.4); }
.sidebar .has-children > .tree-toggle:active { background: #f8fafc; }
.sidebar .has-children > .tree-toggle .tree-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    rotate: -45deg; /* closed ▸ */
    transition: rotate .15s ease, border-color .15s ease;
}
.sidebar .has-children.is-open > .tree-toggle .tree-caret { rotate: 45deg; /* open ▾ */ }
.sidebar .count-badge {
    margin-left: 6px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 6px;
    font-size: 11px;
    color: var(--muted);
}
.sidebar .page-count-badge {
    margin-left: 6px;
    background: #eef6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 11px;
    color: #1e40af;
}
.sidebar .has-children > ul.is-collapsed { display: none; }

/* mobile default collapse */
@media (max-width: 768px) {
    .sidebar .has-children > ul { display: none; }
    .sidebar .has-children.is-open > ul { display: block; }
}

/* Campus Map Section */
.campus-map-section {
    margin-bottom: 30px;
}

.map-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.map-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.map-box:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

.map-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b35;
}

.map-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.map-placeholder i {
    font-size: 48px;
    color: #ff6b35;
    margin-bottom: 15px;
    display: block;
}

.map-placeholder p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.map-placeholder small {
    font-size: 14px;
    color: #666;
}

/* Disclaimer Section */
.disclaimer-section {
    margin-bottom: 30px;
}

.disclaimer-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.disclaimer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.disclaimer-box:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

.disclaimer-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b35;
}

.disclaimer-box p {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Footer */
.footer {
    background: var(--panel);
    color: var(--text);
    margin-top: 60px;
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.footer::before { display: none; }

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px 30px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h4 i {
    color: #ff6b35;
}

.footer-section p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

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

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    text-decoration: none;
    color: var(--muted);
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section a:hover {
    color: var(--accent);
    transform: translateX(5px);
    font-weight: 600;
}

.footer-section a i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 25px 30px;
    text-align: center;
    background: transparent;
}

.footer-bottom p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-bottom p i { color: var(--accent); }

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        padding: 20px;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
    
    .nav-menu {
        display: none;
    }
}

/* Floating Music Player */
.music-player {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  width: 320px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.music-header {
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.music-cover { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.15); overflow:hidden; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.music-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.music-title { font-weight:900; font-size:14px; color:#fff; line-height:1.2; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { font-size:12px; color: rgba(255,255,255,0.85); }
.music-controls { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; }
.music-buttons { display:flex; align-items:center; gap:10px; }
.music-btn { appearance:none; border:1px solid var(--border); background:#fff; color:var(--text); border-radius:999px; width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition: box-shadow .15s ease, transform .05s ease, border-color .15s ease; }
.music-btn:hover { box-shadow:0 2px 10px rgba(0,0,0,0.08); border-color: rgba(255,107,53,0.4); transform: translateY(-1px); }
.music-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; border: none; width:40px; height:40px; }
.music-progress { display:flex; align-items:center; gap:8px; flex:1; }
.music-progress .t-current, .music-progress .t-total { width: 42px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11px; }
.music-progress input[type="range"] { width:100%; height: 6px; appearance: none; background: transparent; }
.music-progress input[type="range"]::-webkit-slider-runnable-track { height:6px; background: linear-gradient(90deg, rgba(255,107,53,0.35), rgba(247,147,30,0.35)); border-radius: 999px; }
.music-progress input[type="range"]::-webkit-slider-thumb { appearance: none; width:14px; height:14px; background: var(--accent); border-radius: 50%; margin-top: -4px; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.music-progress input[type="range"]::-moz-range-track { height:6px; background: linear-gradient(90deg, rgba(255,107,53,0.35), rgba(247,147,30,0.35)); border-radius: 999px; }
.music-progress input[type="range"]::-moz-range-thumb { width:14px; height:14px; background: var(--accent); border-radius: 50%; border: none; }
.music-meta { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; font-size:11px; color:var(--muted); }
.music-list-toggle { margin-left:auto; }
.music-queue { max-height: 220px; overflow:auto; border-top:1px solid var(--border); display:none; }
.music-queue .queue-item { display:flex; align-items:center; gap:10px; padding:8px 12px; cursor:pointer; transition: background .15s ease; }
.music-queue .queue-item:hover { background:#f9fafb; }
.music-queue .queue-item.is-active { background: rgba(255,107,53,0.06); border-left: 3px solid var(--accent); }
.queue-item .q-cover { width:32px; height:32px; border-radius:8px; background:#f3f4f6; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.queue-item .q-cover img { width:100%; height:100%; object-fit: cover; }
.queue-item .q-title { font-size:13px; font-weight:800; color:var(--text); }
.queue-item .q-artist { font-size:12px; color:var(--muted); }
.music-close { position:absolute; top:8px; right:8px; border:none; background:rgba(255,255,255,0.2); color:#fff; width:28px; height:28px; border-radius:999px; cursor:pointer; }
.music-close:hover { background:rgba(255,255,255,0.35); }

@media (max-width: 480px) {
  .music-player { width: calc(100% - 20px); right: 10px; bottom: 10px; }
}

/* Minimized state */
.music-player.is-minimized {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
}
.music-player.is-minimized .music-header,
.music-player.is-minimized .music-controls,
.music-player.is-minimized .music-meta,
.music-player.is-minimized .music-queue,
.music-player.is-minimized .music-close { display: none !important; }
.music-mini-btn {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.music-mini-btn i { font-size: 18px; }
.music-player.is-minimized .music-mini-btn { display: flex; align-items: center; justify-content: center; }

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }
    .nav-container {
        padding: 0 20px;
    }
    
    .nav-left {
        gap: 20px;
    }
    
    .nav-center {
        margin: 0 10px;
    }
    
    .search-container {
        max-width: 300px;
    }
    
    .nav-right {
        gap: 15px;
    }
    
    .main-container {
        padding: 10px;
        flex-direction: column;
        gap: 15px;
    }
    
    /* Make sidebar off-canvas on mobile */
    .sidebar {
        position: fixed;
        top: 70px; /* below nav */
        left: 0;
        height: calc(100vh - 70px);
        width: min(86vw, 340px);
        border-radius: 0 14px 0 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1001;
        overflow-y: auto;
        will-change: transform;
        touch-action: pan-y;
    }
    .sidebar.is-open { transform: translateX(0); }
    
    /* Swipe indicator for mobile */
    .sidebar-swipe-indicator {
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 60px;
        background: rgba(255, 107, 53, 0.3);
        border-radius: 0 4px 4px 0;
        z-index: 999;
        transition: opacity 0.3s ease;
    }
    .sidebar.is-open ~ .sidebar-swipe-indicator {
        opacity: 0;
    }
    
    /* Larger sidebar text and spacing */
    .sidebar-section h3 {
        font-size: 20px;
        padding: 18px 20px 14px;
    }
    
    .sidebar-section a {
        font-size: 18px;
        padding: 14px 20px;
        min-height: 52px;
    }
    
    .sidebar-section a i {
        font-size: 18px;
        width: 22px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 20px;
    }
    
    .quick-action-btn {
        padding: 14px 10px;
        font-size: 14px;
        min-height: 64px;
    }
    
    .quick-action-btn i {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    /* Remove page cards grid layout on mobile - show as simple list */
    .category-pages-grid {
        display: block !important;
        grid-template-columns: none !important;
    }
    
    .category-page-card {
        display: block !important;
        width: 100% !important;
        padding: 25px !important;
        margin-bottom: 20px !important;
        border-radius: 12px !important;
        background: var(--panel) !important;
        border: 1px solid var(--border) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
    
    /* Show thumbnails on mobile, scale nicely */
    .category-page-card .page-thumb {
        display: block !important;
        width: 100% !important;
        margin-bottom: 12px !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }
    
    .category-page-card .page-card-body {
        padding: 0 !important;
    }
    
    .category-page-card .page-card-title {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        color: var(--text) !important;
    }
    
    .category-page-card .page-card-description {
        font-size: 18px !important;
        line-height: 1.5 !important;
        margin-bottom: 15px !important;
        color: var(--muted) !important;
    }
    
    .category-page-card .page-card-meta-row {
        font-size: 16px !important;
        margin-bottom: 15px !important;
    }
    
    .category-page-card .card-cta {
        font-size: 16px !important;
        padding: 12px 20px !important;
        min-height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .main-content {
        order: 2;
        padding: 20px;
        border-radius: 0;
    }
    
    .content-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .hero-section { padding: 20px; }
    .hero-content h1 { font-size: 32px; }
    .hero-subtitle { font-size: 16px; margin-bottom: 16px; }
    .hero-actions { gap: 10px; }
    
    .content-header h1 {
        font-size: 40px;
        line-height: 1.1;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    /* Larger category boxes on mobile */
    .category-box {
        padding: 30px;
    }
    
    .category-box h3 {
        font-size: 24px;
        margin-bottom: 18px;
    }
    
    .category-box a {
        font-size: 18px;
        padding: 14px 18px;
        min-height: 52px;
    }
    
    .category-box a i {
        font-size: 18px;
    }
    
    /* Much larger rich content text */
    .rich-content h1 { font-size: 36px; line-height: 1.2; }
    .rich-content h2 { font-size: 32px; line-height: 1.2; }
    .rich-content h3 { font-size: 28px; line-height: 1.3; }
    .rich-content h4 { font-size: 24px; line-height: 1.3; }
    .rich-content p { font-size: 18px; line-height: 1.7; margin-bottom: 16px; }
    .rich-content li { font-size: 18px; line-height: 1.7; }
    .rich-content ul, .rich-content ol { margin-bottom: 16px; }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 20px 20px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo span {
        display: none;
    }
    
    .nav-center {
        margin: 0 5px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .search-input {
        font-size: 16px;
        padding: 12px 52px 12px 40px;
        height: 44px !important;
        min-height: 44px !important;
    }
    
    .main-container {
        padding: 8px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .category-box {
        padding: 25px;
    }
    
    .page-header {
        padding: 15px;
    }
    
    .back-btn {
        font-size: 18px;
        padding: 14px 24px;
        min-height: 52px;
    }
    
    .content-header h1 {
        font-size: 32px;
        line-height: 1.1;
    }
    
    /* Even larger text for very small screens */
    .rich-content h1 { font-size: 32px; }
    .rich-content h2 { font-size: 28px; }
    .rich-content h3 { font-size: 24px; }
    .rich-content p { font-size: 18px; }
    .rich-content li { font-size: 18px; }
    
    /* Make page cards even more prominent on small screens */
    .category-page-card {
        padding: 30px !important;
        margin-bottom: 25px !important;
    }
    
    .category-page-card .page-card-title {
        font-size: 24px !important;
    }
    
    .category-page-card .page-card-description {
        font-size: 20px !important;
    }
    
    .category-page-card .page-card-meta-row {
        font-size: 18px !important;
    }

    /* Search/Popular results on small phones */
    .categories-section { padding: 0 12px 20px !important; }
    .search-results { padding: 0 4px; }
    .search-header { padding: 14px 16px !important; margin-bottom: 18px !important; }
    .search-header h3 { font-size: 17px !important; }
    .search-header p { font-size: 13px !important; }
    .search-result-item { padding: 14px 12px !important; gap: 10px !important; }
    .result-icon, .result-thumb { width: 44px !important; height: 44px !important; }
    .result-rank { width: 28px !important; height: 28px !important; font-size: 13px !important; }
    .result-content h3 { font-size: 15px !important; }
    .result-content p { font-size: 12px !important; }
    .result-meta { gap: 8px !important; font-size: 11px !important; }
    .results-page-header { padding: 18px 0 16px !important; }
    .results-page-header h1 { font-size: 22px !important; }
    .results-subtitle { font-size: 14px !important; }
    .no-results { padding: 50px 16px !important; }
    .no-results i { font-size: 44px !important; }
    .no-results h3 { font-size: 18px !important; }
    .no-results p { font-size: 14px !important; }

    /* Search suggestions on small phones */
    .search-suggestions {
      max-height: min(55vh, 240px) !important;
      border-radius: 12px !important;
    }
    .search-suggestions .suggestion-item { padding: 10px 12px !important; gap: 10px !important; }
    .search-suggestions .suggestion-thumb {
      width: 36px !important;
      height: 36px !important;
      font-size: 13px !important;
    }
    .search-suggestions .suggestion-text .title { font-size: 14px !important; }
    .search-suggestions .suggestion-text .desc { font-size: 11px !important; }

    /* Quick actions - 2 cols on very small screens so buttons stay tappable */
    .quick-actions { grid-template-columns: 1fr 1fr !important; }
    .quick-actions .quick-action-btn:last-child { grid-column: 1 / -1; }
}

/* Optimized Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.category-box, .about-box, .map-box, .disclaimer-box {
    animation: fadeIn 0.3s ease-out;
}

/* Optimized Hover Effects */
.category-box:hover {
    border-color: rgba(255, 107, 53, 0.4);
}

.sidebar-section a:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
}

.sidebar-section li.is-active > .sidebar-category-link {
    background: rgba(255,107,53,0.08);
    color: #ff6b35;
    font-weight: 600;
}

/* Results page header (replaces hero when viewing Popular/Search) */
.results-page-header {
    padding: 24px 0 20px;
    text-align: center;
}

.results-page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.results-page-header h1 i {
    color: var(--accent);
}

.results-subtitle {
    font-size: 15px;
    color: var(--muted);
    font-weight: 500;
}

/* Search Results */
.search-results {
    width: 100%;
}

.search-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(247, 147, 30, 0.05) 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 107, 53, 0.15);
    text-align: center;
}

.search-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-header h3 i {
    color: var(--accent);
}

.search-header p {
    color: var(--muted);
    font-size: 14px;
}

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

.search-result-item {
    background: var(--panel);
    border-radius: 14px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-result-item:hover {
    border-color: rgba(255, 107, 53, 0.35);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.1);
    transform: translateY(-1px);
}

.result-rank {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--border);
    color: var(--muted);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #5c4a00;
}

.result-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #333;
}

.result-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.result-icon,
.result-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.result-thumb.result-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.result-thumb.has-image {
    background: var(--border);
}

.result-thumb.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.result-content p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 12px;
}

.result-views {
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-views i {
    color: var(--accent);
    font-size: 11px;
}

.result-category {
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 500;
}

.result-date {
    color: var(--muted);
}

.result-arrow {
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.search-result-item:hover .result-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.no-results {
    text-align: center;
    padding: 80px 24px;
    background: var(--panel);
    border-radius: 14px;
    border: 1px dashed var(--border);
}

.no-results i {
    font-size: 56px;
    color: var(--border);
    margin-bottom: 24px;
    display: block;
}

.no-results h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.no-results p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 107, 53, 0.3);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Screen Styles */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 8px;
    background-color: #e5e7eb;
}

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

.skeleton-stat {
    height: 60px;
    width: 120px;
    margin: 10px;
    display: inline-block;
}

.skeleton-category-card {
    height: 180px;
    width: 100%;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text-short {
    height: 16px;
    width: 60%;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text-title {
    height: 24px;
    width: 80%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 12px;
}

/* Enhanced Loading States */
/* global loading overlay removed */

.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.loading-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-top: 2px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Retry Button Styles */
.retry-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.retry-btn:hover {
    background: #e55a2b;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.retry-section {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 12px;
    margin: 20px 0;
}

.retry-message {
    color: var(--muted);
    margin-bottom: 15px;
    font-size: 14px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
} 

/* Rich Content Styles */
.rich-content {
    line-height: 1.7;
    color: #333;
    font-size: 16px;
    /* Default alignment for rich text containers.
       TinyMCE alignment should be allowed to override this via classes/inline styles. */
    text-align: left;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    margin-top: 30px;
    margin-bottom: 20px;
    color: #ff6b35;
    font-weight: 700;
    line-height: 1.3;
}

.rich-content h1 {
    font-size: 2.5em;
    border-bottom: 3px solid rgba(255, 107, 53, 0.2);
    padding-bottom: 10px;
}

.rich-content h2 {
    font-size: 2em;
    border-bottom: 2px solid rgba(255, 107, 53, 0.2);
    padding-bottom: 8px;
}

.rich-content h3 {
    font-size: 1.5em;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    padding-bottom: 5px;
}

.rich-content h4 {
    font-size: 1.25em;
}

.rich-content h5 {
    font-size: 1.1em;
}

.rich-content h6 {
    font-size: 1em;
}

.rich-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: justify;
}

/* Respect TinyMCE alignment outputs on the public site */
.rich-content p.aligncenter,
.rich-content p[align="center"] {
    text-align: center !important;
}

/* TinyMCE alignment can be saved as inline styles on block elements */
.rich-content [style*="text-align: center"],
.rich-content [style*="text-align:center"],
.rich-content [align="center"],
.rich-content .aligncenter {
    text-align: center !important;
}

/* Rare TinyMCE output */
.rich-content center {
    text-align: center !important;
}

/* Tiny commonly outputs images with class "aligncenter"/"alignleft"/"alignright" */
.rich-content img.aligncenter {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

/* If Tiny centers a wrapper, its child paragraphs should follow */
.rich-content [style*="text-align: center"] p,
.rich-content [style*="text-align:center"] p,
.rich-content [align="center"] p,
.rich-content .aligncenter p {
    text-align: center !important;
}

.rich-content img.alignleft {
    float: left;
    margin-right: 20px !important;
    margin-left: 0 !important;
}

.rich-content img.alignright {
    float: right;
    margin-left: 20px !important;
    margin-right: 0 !important;
}

.rich-content ul,
.rich-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.rich-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.rich-content ul li {
    position: relative;
}

.rich-content ul li::before {
    content: '•';
    color: #ff6b35;
    font-weight: bold;
    position: absolute;
    left: -20px;
}

.rich-content ol {
    counter-reset: item;
}

.rich-content ol li {
    counter-increment: item;
    position: relative;
}

.rich-content ol li::before {
    content: counter(item) '.';
    color: #ff6b35;
    font-weight: bold;
    position: absolute;
    left: -25px;
}

.rich-content blockquote {
    border-left: 5px solid #ff6b35;
    padding: 20px 25px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 0 12px 12px 0;
    position: relative;
}

.rich-content blockquote::before {
    content: '"';
    font-size: 3em;
    color: #ff6b35;
    position: absolute;
    top: -10px;
    left: 15px;
    opacity: 0.3;
}

.rich-content code {
    background: rgba(255, 107, 53, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #ff6b35;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.rich-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid rgba(255, 107, 53, 0.1);
    position: relative;
}

.rich-content pre::before {
    content: 'Code';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.8em;
    color: #ff6b35;
    font-weight: 600;
    background: rgba(255, 107, 53, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.rich-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: #333;
}

.page-description {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 25px;
    font-style: italic;
    padding: 15px 20px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.featured-image {
    margin: 25px 0;
    text-align: center;
    position: relative;
}

.page-featured-img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.2);
    transition: all 0.4s ease;
    border: 3px solid rgba(255, 107, 53, 0.1);
}

.page-featured-img:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(255, 107, 53, 0.3);
    border-color: rgba(255, 107, 53, 0.3);
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 2px solid rgba(255, 107, 53, 0.1);
}

.rich-content img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.3);
}

.rich-content video {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin: 20px 0;
    border: 2px solid rgba(255, 107, 53, 0.1);
}

.rich-content a {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.rich-content a:hover {
    color: #f7931e;
    border-bottom-color: #f7931e;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 2px solid rgba(255, 107, 53, 0.1);
}

.rich-content th {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 1.1em;
}

.rich-content td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
    font-size: 1em;
}

.rich-content tr:nth-child(even) {
    background: rgba(255, 107, 53, 0.03);
}

.rich-content tr:hover {
    background: rgba(255, 107, 53, 0.08);
}

.rich-content tr:last-child td {
    border-bottom: none;
}

/* Special content sections */
.rich-content .highlight-box {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(247, 147, 30, 0.1));
    border: 2px solid rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
}

.rich-content .highlight-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 12px 12px 0 0;
}

.rich-content .tip-box {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.1));
    border: 2px solid rgba(39, 174, 96, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
}

.rich-content .tip-box::before {
    content: '💡 Tip';
    position: absolute;
    top: -10px;
    left: 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.rich-content .warning-box {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(230, 126, 34, 0.1));
    border: 2px solid rgba(243, 156, 18, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
}

.rich-content .warning-box::before {
    content: '⚠️ Warning';
    position: absolute;
    top: -10px;
    left: 20px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Mobile optimizations for image modal */
@media (max-width: 768px) {
    .image-modal-close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        z-index: 10001;
        background: rgba(0, 0, 0, 0.8);
    }
    
    .image-modal-content {
        max-width: 95%;
        max-height: 85vh;
        padding: 10px;
    }
}

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

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

/* Crash recovery styles removed - no longer needed */ 