  /* ================================================================
1. CSS RESET & GLOBAL DEFAULTS
================================================================
*/
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  :root {
    /* PRIMARY: Deep Amethyst */
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: rgba(124, 58, 237, 0.08);
    --primary-glow: rgba(124, 58, 237, 0.25);
    
    /* NEUTRALS: 2026 Slate Palette */
    --text-main: #0f172a;      /* Deepest Navy for high-end readability */
    --text-muted: #64748b;     /* Slate grey for secondary info */
    --text-inverse: #ffffff;
    
    /* GLASS & BORDERS */
    --border: rgba(15, 23, 42, 0.08); /* More intentional, visible border */
    --glass-white: rgba(255, 255, 255, 0.7);
    --glass-card: rgba(255, 255, 255, 0.85);
    --glass-blur: 16px;        /* Increased for premium 'frosted' look */
    
    /* SHADOWS: Multi-layered for depth */
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    
    /* RADII */
    --border-radius-lg: 32px;  /* 'Super-elliptical' corners are very 2026 */
    --border-radius-md: 20px;
    --border-radius-sm: 12px;
}

[data-theme="blue"] {
    /* ALTERNATE: Electric Sapphire */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.08);
    --primary-glow: rgba(37, 99, 235, 0.3);
    --text-main: #020617;
    --text-muted: #475569;
    --border: rgba(30, 41, 59, 0.1);
}

[data-theme="emerald"] {
    --primary: #059669; /* Rich Emerald */
    --primary-hover: #047857;
    --primary-light: rgba(5, 150, 105, 0.08);
    --primary-glow: rgba(5, 150, 105, 0.3);
    
    --text-main: #064e3b; /* Deep Forest Navy */
    --text-muted: #475569;
    --border: rgba(6, 78, 59, 0.1);
}

[data-theme="terracotta"] {
    --primary: #e11d48; /* Vibrant Rose-Clay */
    --primary-hover: #be123c;
    --primary-light: rgba(225, 29, 72, 0.08);
    --primary-glow: rgba(225, 29, 72, 0.25);
    
    --text-main: #450a0a; /* Warm Cocoa Black */
    --text-muted: #71717a;
    --border: rgba(69, 10, 10, 0.08);
}

[data-theme="cyber"] {
    --primary: #84cc16; /* Electric Lime */
    --primary-hover: #65a30d;
    --primary-light: rgba(132, 204, 22, 0.1);
    --primary-glow: rgba(132, 204, 22, 0.4);
    
    --text-main: #1a2e05; /* Deep Olive Black */
    --text-muted: #52525b;
    --border: rgba(20, 20, 20, 0.12);
}

  /* ================================================================
2. CORE LAYOUT
================================================================
*/
  body {
    /* Font: Plus Jakarta Sans is the king of 2026 Tech UI */
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    
    /* Background: Softened the image overlay so UI pops */
    background-image: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.85)), 
                      url('../images/community-help.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    
    /* TYPOGRAPHY FIXES */
    font-size: 0.8rem !important; /* Standard 15px for better readability */
    line-height: 1.5 !important;    /* Breathable spacing */
    color: var(--text-main) !important;
    
    /* ANTI-ALIASING: Makes fonts look sharper/thinner on Retina */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* LETTER SPACING: Professional 'Tight' look for headings */
    letter-spacing: -0.02em !important; 
    
    overflow-x: hidden;
}

  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: -1;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Custom Scrollbar Styles */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
  }

  /* ================================================================
3. TYPOGRAPHY
================================================================
*/

/* Headings Upgrade */
h1, h2, h3 {
    letter-spacing: -0.05em !important; /* Tighter for headlines */
    font-weight: 800;
}
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.2;
  }

  h1 {
    font-size: 2rem;
    font-weight: 800;
  }

  h2 {
    font-size: 1.5rem;
    font-weight: 700;
  }

  h3 {
    font-size: 1.25rem;
    font-weight: 700;
  }

  p {
    margin-bottom: 1rem;
  }

  .logo:hover i {
    transform: rotate(-10deg) scale(1.2);
    color: var(--primary-hover);
  }

  .logo span {
    color: var(--primary);
    transition: color 0.3s ease;
  }

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

  .stats-bar {
    display: flex;
    gap: 2rem;
    /* font-size: 0.9rem; */
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .stats-bar strong {
    color: var(--primary) !important;
    /* font-size: 1.1rem; */
  }

  .bell-container .fa-bell {
    font-size: 16px !important;
    /* Forces the icon to stay small */
    transition: transform 0.3s ease;
  }

  /* Theme-specific overrides: When the data-theme is blue, 
   the bell can adopt a blue-accented shadow or color.
*/
  [data-theme="blue"] .bell-container {
    background: var(--primary);
    /* Uses blue primary from theme */
    box-shadow: 0 4px 12px var(--primary-glow);
  }

  /* ==========================================================================
   Y. ANIMATIONS & HOVER EFFECTS
   ========================================================================== */

  /* Hovering over the bell container triggers a sophisticated 
   bell-ringing (shake) animation.
*/
  .bell-container:hover {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.1);
  }

  .bell-container:hover .fa-bell {
    animation: bell-ring 0.6s both;
  }

  @keyframes bell-ring {

    0%,
    100% {
      transform: rotate(0);
    }

    15% {
      transform: rotate(20deg);
    }

    30% {
      transform: rotate(-15deg);
    }

    45% {
      transform: rotate(10deg);
    }

    60% {
      transform: rotate(-5deg);
    }

    80% {
      transform: rotate(2deg);
    }
  }

  /* Notification Badge styling for the number displayed 
   on top of the bell.
*/
  .notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ffffff;
    color: #ef4444;
    font-size: 9px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ef4444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  [data-theme="blue"] .notification-badge {
    color: var(--primary);
    border-color: var(--primary);
  }

  /* ================================================================
4. SITE HEADER
================================================================
*/
  .site-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed) ease;
  }

  .header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

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

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

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

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

  /* ================================================================
5. SIDEBAR NAVIGATION
================================================================
*/
  .app-shell {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    min-height: 80vh;
  }

  .sidebar {
    width: 350px;
    padding: 2.5rem 1.5rem;
    position: sticky;
    top: 60px;
    /* height: calc(90vh - 60px); */
    overflow-y: auto;
  }

  .nav-section {
    /* background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); */
    border: 1px solid var(--border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
  }

  /* Architectural Detail Watermark */
  .nav-section::after {
    content: "\f1ad";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -15px;
    right: -5px;
    font-size: 3.5rem;
    color: var(--primary);
    opacity: 0.04;
    pointer-events: none;
  }

  .nav-section small {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.65rem;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 4px solid var(--primary);
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
    margin-top: 4px;
  }

  .nav-item i {
    width: 20px;
    font-size: 1.15rem;
  }

  .nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(5px);
  }

  .nav-item.active {
    background: var(--primary);
    color: #fff !important;
    box-shadow: 0 8px 16px var(--primary-glow);
  }

  /* ================================================================
6. MAIN CONTENT & CARDS
================================================================
*/
  .main-content {
    flex: 1;
    /* padding: 2.5rem 3.5rem; */
    max-width: 1050px;
    min-width: 0;
    /* Prevents flex-items from breaking layout */
    padding: 2rem;
    transition: padding 0.3s ease;
  }

  .content-card {
    /* background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); */
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
  }

  .content-card::after {
    content: "\f1ad";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -40px;
    right: -30px;
    font-size: 12rem;
    color: var(--primary);
    opacity: 0.02;
    transform: rotate(-10deg);
    pointer-events: none;
  }

  /* ================================================================
7. COMMUNITY GRID & HUB CARDS
================================================================
*/
  .community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
  }

  .community-overview h1,
  .wiki-render h1 {
    margin-bottom: 2rem;
  }

  .community-overview p,
  .wiki-render p {
    margin: 1rem;
  }

  /* Container Reset */
  .wiki-render,
  .wiki-render textarea {

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 0.8rem !important;
    line-height: 1.6;
    word-wrap: break-word;
    /* font-weight: 700 !important; */
    /* Forces normal weight for body text */
    color: #1f2328 !important;
  }

  .wiki-render textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
  }

  .wiki-render {
    font-size: 14px !important;
  }

  /* Fix the Bolding Issue */
  .wiki-render p,
  .wiki-render li {
    font-weight: 400;
    /* Standard weight */
    margin-top: 0;
    margin-bottom: 16px;
  }

  .wiki-render strong {
    font-weight: 600;
    /* Medium-bold for readability */
    color: #000;
  }

  /* Proper Heading Scales */
  .wiki-render h1 {
    font-size: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d0d7de;
    margin-bottom: 16px;
    font-weight: 600;
  }

  .wiki-render h2 {
    font-size: 1.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d0d7de;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
  }

  .wiki-render h3 {
    font-size: 1.25em;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
  }

  /* Horizontal Rule */
  .wiki-render hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #d0d7de;
    border: 0;
  }

  .hub-card {
    /*aspect-ratio: 1 / 1;*/
    /* Forces height to match width precisely */
    width: 100%;
    /* Let the grid determine the width */
    min-width: 200px;

    /* REFINED PADDING & ALIGNMENT */
    padding: 1rem;
    /* Reduced from 2.5rem for a tighter, more professional feel */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Centers content vertically in the square */

    background: var(--glass-white) !important;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border) !important;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
    /* Keeps bell visible */
  }

  .hub-card:hover {
    transform: translateY(-6px) !important;
    /* Slightly subtler lift */
    border-color: var(--primary) !important;
    box-shadow: 0 12px 30px var(--primary-glow) !important;
    background: #fff !important;
  }

  /* Ensuring icons and text don't create extra unwanted space */
  .hub-card i {
    margin-bottom: 4px;
    font-size: 2.5rem;
    /* Standardized size */
  }

  .hub-card h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
  }

  .hub-card p {
    margin: 0;
    font-size: 0.7rem;
    /* color: var(--primary); */
    font-weight: 800;
    /* text-transform: uppercase; */
  }

  .fa-landmark {
    font-size: 2rem;
    color: var(--primary);
    transition: transform 0.3s ease;
  }

  .hub-card.fa-plus {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
    opacity: 0.5;
  }

  /* .btn-primary-header.fa-plus{
    color: #fff;
     margin-bottom: 0; 
      font-size: 1rem; 
  } */

  .hub-card:hover i {
    transform: scale(1.1);
  }

  /* --- THE FIX: BLUE THEME VISIBILITY --- */
  [data-theme="blue"] .bell-container {
    border: 2px solid #ffffff;
    /* Adds a white ring to separate from blue card border */
    box-shadow: 0 0 15px var(--bell-hover-glow);
  }

  .hub-card:hover .bell-container {
    animation: bell-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
    transform: scale(1.1);
  }

  @keyframes bell-shake {

    10%,
    90% {
      transform: translate3d(-0.5px, 0, 0) rotate(-2deg);
    }

    20%,
    80% {
      transform: translate3d(1px, 0, 0) rotate(2deg);
    }

    30%,
    50%,
    70% {
      transform: translate3d(-1px, 0, 0) rotate(-2deg);
    }

    40%,
    60% {
      transform: translate3d(1px, 0, 0) rotate(2deg);
    }
  }

  .bell-container i {
    font-size: 16px !important;
  }

  [data-theme="blue"] .notification-count {
    border-color: #ffffff;
    /* High contrast for blue mode */
  }

  /* --- COMPACT FLOATING BELL --- */
  .bell-container {
    position: absolute;
    top: -12px;
    /* Floats slightly above the card edge */
    right: -10px;
    background: #ef4444;
    /* Alert Red from your screenshot */
    width: 32px;
    /* Compact size */
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .bell-container i {
    font-size: 14px !important;
    /* Forces bell to be small */
  }

  .bell-container:hover {
    transform: scale(1.1) rotate(10deg);
  }

  /* Redesigned Notification Count */
  .notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #ef4444;
    font-size: 9px;
    font-weight: 900;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ef4444;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  /* ================================================================
8. FORMS & INPUT STYLES
================================================================
*/

  .form-header p {
    font-size: 1rem;
    margin-top: 1rem;
  }

  .form-group {
    margin-bottom: 2rem;
  }

  .form-group label,
  .submit-editor-container-box {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
  }

  input,
  /* textarea, */
  select {
    width: 100%;
    padding: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-family: inherit;
    /* font-size: 0.7rem; 
    background: rgba(255, 255, 255, 0.5);*/
    transition: all 0.3s ease;
  }

  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
  }

  /* ================================================================
9. BUTTONS & ACTIONS
================================================================
*/

  /* Sidebar Action Buttons Container */
  .sidebar-footer-action {
    margin-top: 1.5rem;
    /*padding-top: 1.5rem; */
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    /* gap: 10px; */
  }

  .btn-primary-header,
  .btn-submit-main,
  .btn-create-wiki,
  .btn-edit-action,
  .btn-broadcast-sidebar {
    background: var(--primary);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 12px var(--primary-glow);
    cursor: pointer;
    gap: 10px;
    border-radius: 10px;
    /* border: 1px solid #fecaca; */
    padding: 0.75rem;
  }

  .btn-edit-action {
    position: absolute;
    bottom: 24px;
    /* Anchored to the bottom corner */
    right: 24px;
  }

  .btn-broadcast-sidebar {
    margin-top: 1rem;
  }

  .drawer-item {
    padding: 1rem 1rem 0rem 1rem;
    border-bottom: 1px solid var(--border);
    border-left: 14px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
  }

  .drawer-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.01);
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  }

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

  .drawer-header small {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .drawer-text {
    padding: 0rem 1rem;
  }

  .drawer-text h1 {
    font-size: 1rem;
  }

  .drawer-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 800;
  }

  .drawer-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
  }

  /* Architectural Watermark for Drawer */
  #alert-drawer::after {
    content: "\f0a1";
    /* Bullhorn Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 8rem;
    color: var(--primary);
    opacity: 0.03;
    pointer-events: none;
  }

  .tets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    background: #fff1f2;
    color: #ef4444 !important;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #fecaca;
  }

  .btn-primary-header {
    height: 40px;
    padding: 0 1.4rem;
    border-radius: 12px;
    gap: 8px;
    width: 100%;
    white-space: nowrap;
    /* Prevents word wrap strictly */
    overflow: hidden;
    /* Ensures no text bleed */
    text-overflow: ellipsis;
    /* Adds "..." if the container is tiny */
  }

  .btn-submit-main {
    width: 100%;
    padding: 1.25rem;
    border-radius: 16px;
    /* font-size: 1rem; */
    gap: 12px;
  }

  .btn-submit-main:hover,
  .btn-primary-header:hover,
  .btn-edit-action:hover,
  .btn-sync:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px var(--primary-glow);
  }


  .form-actions, .drawer-footer{
    display: flex;
    /* This pushes the buttons to the far edges */
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-bottom: 20px;
    width: 100%;
    /* Ensure it spans the full form width */
  }

  .form-actions {
     display: flex !important;
    flex-direction: row !important; /* Force horizontal layout */
    justify-content: space-between; /* Pushes content to edges */
    align-items: center;
    width: 100% !important;
    padding: 20px 0;
    box-sizing: border-box;
  }

  .btn-cancel,
  .btn-sync {
    /* This ensures both buttons are exactly the same width */
    width: 180px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
    /* Includes padding in width calculation */
  }

  .btn-sync {
    background-color: var(--primary);
    /* Or your primary blue */
    color: white;
    border: none;
    cursor: pointer;
    margin: 0;
    /* Safety: keeps it right even if cancel is missing */
  }

  .btn-cancel {
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    transition: background 0.2s;
  }

  .btn-cancel:hover {
    background: #f1f5f9;
    color: var(--text-main);
  }

  .professional-form {
    margin-top: 2rem;
  }

  #submissionForm .editor-container-box {
    border: none !important;
  }

  #submissionForm .markdown-preview {
    background: #fff !important;
  }

  #submissionForm textarea #drawer-form textarea {
    background: #fff !important;
    border-radius: 0 0 14px !important;
    width: 100% !important;
    min-height: 150px !important;
    overflow-y: auto;
  }

  /* ================================================================
10. ALERT & BROADCAST SYSTEM
================================================================
*/
  .alert-collapsible-wrapper {
    margin-bottom: 2.5rem;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .alert-strip-header {
    background: var(--text-main);
    color: white;
    padding: 1.1rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
  }

  .live-indicator {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-right: 12px;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    animation: pulse 2s infinite;
  }

  .alert-drawer-body {
    display: none;
    background: transparent;
    max-height: 350px;
    overflow-y: auto;
  }

  .alert-drawer-body.is-open {
    display: block;
  }

  .urgency-low {
    border-left-color: #94a3b8;
  }

  .urgency-medium {
    border-left-color: #3b82f6;
  }

  .urgency-high {
    border-left-color: #f59e0b;
  }

  .urgency-critical {
    border-left-color: #ef4444;
    animation: critical-bg 2s infinite;
  }

  @keyframes critical-bg {

    0%,
    100% {
      background: #fff;
    }

    50% {
      background: rgba(239, 68, 68, 0.05);
    }
  }

  /* ================================================================
11. SEARCH & CONTROLS
================================================================
*/
  .search-wrapper {
    position: relative;
    width: 100%;
    margin: 1rem 0;
  }

  .search-wrapper i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
  }

  #communitySearch {
    padding: 1rem 1rem 1rem 3.8rem;
    border: 2px solid var(--border);
    border-radius: 18px;
    font-size: 0.7rem;
  }

  /* ================================================================
12. THEME SWITCHER SPECIFICS
================================================================
*/
  .community-switcher {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 40px 10px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
  }

  /* ================================================================
13. FOOTER
================================================================
*/
  .site-footer {
    background: var(--glass-white);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    padding: 1rem;
    margin-top: auto;
  }

  .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .footer-logo {
    font-weight: 800;
    font-size: 1.3rem;
  }

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

  .footer-links {
    display: flex;
    gap: 35px;
  }

  .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
  }

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

  /* ================================================================
15. UTILITIES & ANIMATIONS
================================================================
*/
  @keyframes pulse {

    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.5;
      transform: scale(1.1);
    }
  }

  .fa-spin {
    animation: fa-spin 1s infinite linear;
  }

  @keyframes fa-spin {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  .editor-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 1000px;
    background: #fff;
    z-index: 10000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
  }

  .editor-drawer.is-open {
    transform: translateX(0);
  }

  .drawer-inner {
    height: 100vh;
    height: 100dvh;
    /* dvh fixes mobile height */
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  #drawer-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .hub-context {
    background: #f5f3ff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #ddd6fe;
    font-variant: all-small-caps;
  }

  .hub-context small {
    display: block;
    font-size: 10px;
    color: #7c3aed;
    font-weight: 800;
    text-transform: uppercase;
  }

  .field {
    margin-bottom: 12px;
    flex-shrink: 0;
  }

  .field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
  }

  /* THE FLEXIBLE BOX */
  .editor-container-box {
    flex: 1;
    /* Stretch to fill all available space */
    display: block !important;
    flex-direction: column;
    min-height: 200px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    padding: 10px 0px;
  }

  .editor-container-box label,
  .editor-container-box .tools {
    padding: 10px 5px;
  }

  .editor-container-box label {
    font-size: 0.8rem;
    font-weight: 700;
  }

  .submit-editor-container-box {
    /*flex: 1;*/
    /* Stretch to fill all available space */
    display: flex;
    flex-direction: column;
    min-height: 200px;
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
  }

  .submit-editor-container-box>textarea {
    border-radius: 0 0 14px;
  }

  .submit-toolbar {
    margin-top: 1rem;
    background: #f8fafc;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
    /* border-bottom: 1px solid #cbd5e1; */
  }

  /* Specifically target the Markdown render area */
  .wiki-render em {
    font-style: italic !important;
    font-weight: normal !important;
    /* Force un-bolding if everything is currently bold */
    color: #24292f;
  }

  .wiki-render strong,
  .wiki-render b {
    font-weight: 600 !important;
    /* GitHub-style semi-bold */
  }



  .toolbar {
    background: #f8fafc;
    padding: 6px 10px;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .tools button {
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    margin-right: 4px;
  }

  .modes {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 4px;
  }

  .modes button {
    border: none;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    background: transparent;
    color: #64748b;
  }

  .modes button.active {
    background: #fff;
    color: var(--primary);
    ;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  #f-content,
  .markdown-preview {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    /* font-size: 14px; */
    line-height: 1.6;
    overflow-y: auto;
    width: 100%;
    min-height: 200px;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  }

  .markdown-preview {
    padding: 0 !important;
  }

  .submit-editor-container-box .markdown-preview {
    background: #fafafa !important;
    border: 1px solid var(--border) !important;
  }

  .markdown-preview {
    /*background: #fafafa;*/
    flex: 1;
    /* Tells the textarea to stretch to the bottom of the container */
    width: 100%;
    resize: vertical;
    /* Allows the user to manually drag-resize if they want */
    min-height: 200px;
    padding: 15px;
    /*border: 1px solid var(--border);*/
    border-radius: 0 0 6px 6px;
    /* Rounds only bottom corners to match toolbar */
    outline: none;
    font-family: inherit;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  }

  .markdown-preview p,
  .markdown-preview ol {
    padding: 10px;
  }

  .btn-sync:active {
    transform: translateY(0);
  } */

  .drawer-close {
    background: var(--primary-light);
    color: #475569;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
  }

  /* ================================================================
  FINISH
  ================================================================
  */

  .mobile-menu-toggle {
    display: none;
  }


  /*
IMAGE UPLOAD
 */

  .editor-toolbar {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .wiki-image-upload {
    cursor: pointer;
    background: #673ab7;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .upload-status {
    font-size: 0.8rem;
    color: #aaa;
  }

  /* ================================================================
   MARKETPLACE HTMLS
   ================================================================ */

  /* Container constraint */
  .marketplace-container {
    max-width: 800px;
    /* Limits width so cards don't stretch too far */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
  }

  .ad-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .ad-detail-footer {
    display: flex;
    justify-content: flex-end;
    /* Pushes content to the right */
    margin-top: 20px;
    width: 100%;
  }

  .ad-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .ad-detail-footer {
    display: flex;
    justify-content: flex-end;
    /* Pushes content to the right */
    margin-top: 20px;
    width: 100%;
  }

  /* Compact Professional Card */
  .ad-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    height: 140px;
    /* Fixed height for consistency */
    transition: border-color 0.2s;
    cursor: pointer;
    margin-bottom: 0.4rem;
  }

  .ad-card:hover {
    border-color: var(--primary-glow);
    /* Subtle GitHub-blue highlight on hover */
  }

  /* Left Details Pane */
  .ad-card-body {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .ad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .ad-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #24292e;
  }

  .ad-price {
    font-size: 1rem;
    font-weight: 700;
    color: #28a745;
  }

  .ad-description {
    font-size: 0.85rem;
    color: #586069;
    line-height: 1.4;
    margin: 8px 0;
  }

  /* Right Image Pane */
  .ad-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    object-fit: cover;
    background-color: #f6f8fa;
  }

  .classified-card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
  }

  /* New Badge Styling */
  .badge-new-flash {
    background-color: #28a745;
    /* Green to match your price tags */
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    animation: flash-pulse 2s infinite;
    display: inline-block;
  }

  .tr-community {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: bold;
    text-transform: uppercase;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
  }

  .ad-category-tag {
    background: var(--primary-glow);
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
  }

  /* Core Placeholder Styling */
  .ad-card-media {
    width: 140px;
    /* height: 100px; */
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
  }

  .default-icon i {
    font-size: 2.2rem;
    opacity: 0.8;
  }

  /* Application-Matched Category Colors */
  /* Uses the Primary Blue from your 'Contribute' button */
  .parking,
  .rentals {
    background-color: #f0f7ff;
  }

  .parking i,
  .rentals i {
    color: #007bff;
  }

  /* Uses the Success Green from your price labels */
  .services,
  .food {
    background-color: #f0fff4;
  }

  .services i,
  .food i {
    color: #28a745;
  }

  /* Neutral for Items/General to maintain hierarchy */
  .items-for-sale,
  .general {
    background-color: #f8f9fa;
  }

  .items-for-sale i,
  .general i {
    color: #6a737d;
  }

  .filter-btn {
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid #eee;
    background: white;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
  }

  .filter-btn.active,
  .filter-btn:hover {
    background: var(--primary);
    /* ResiHub Blue */
    color: white;
    border-color: var(--primary-light);
  }

  /*
  ==============================
 LIST SERVICE HTML
  ==============================
  */

  .form-header {
    margin-bottom: 10px;
    border-bottom: 2px solid var(--bg-light);
  }

  .form-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin: 0;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
  }

  /* Professional Input Styling */
  .modern-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: var(--transition);
    box-sizing: border-box;
  }

  .modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
  }

  /* Enhanced Upload Zone */
  .upload-zone {
    border: 2px dashed var(--primary);
    background: #f0f7ff;
    border-radius: var(--border-radius-sm);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
  }

  .upload-zone:hover {
    background: #e1efff;
    border-color: var(--primary-hover);
  }

  .upload-zone i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
  }

  #imageInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
  }

  /* Filename Chips */
  #fileNamesDisplay {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
  }

  .file-chip {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: chipAppear 0.3s ease-out;
  }

/* Modal Background - Modal Styles */

.gallery-section {
    position: sticky;
    top: 20px;
  }

  .thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
  }

  .thumb:hover {
    border-color: var(--primary);
  }

  .thumb.active {
    border-color: var(--primary);
    opacity: 0.7;
  }

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

 .main-image-container {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 4 / 3;
    border: 1px solid #eee;
    margin-bottom: 15px;
  }

  .main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
  }

  /* Pulse Animation */
  @keyframes flash-pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
      transform: scale(1);
    }

    70% {
      box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
      transform: scale(1.05);
    }

    100% {
      box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
      transform: scale(1);
    }
  }
  
.modal-overlay { display: none; position: fixed; z-index: 999999 !important; top: 60px; left: 0; width: 100%; height: 100%; background: var(--primary-light); backdrop-filter: blur(5px); align-items: center; justify-content: center; }
.modal-main-content { display: flex; flex-direction: column; align-items: center; max-width: 90%; }
#modalImg { max-height: 70vh; max-width: 100%; border-radius: 8px; }
.modal-preview-bar { display: flex; gap: 10px; margin-top: 20px; overflow-x: auto; }
.modal-preview-thumb { width: 50px; height: 50px; opacity: 0.5; cursor: pointer; border: 2px solid transparent; }
.modal-preview-thumb.active { opacity: 1; border-color: var(--primary-glow); }
.modal-nav { background: none; border: none; color: var(--primary); font-size: 30px; cursor: pointer; padding: 20px; }
.modal-nav next{
  color: var(--primary);
}
.close-modal { position: absolute; top: 40px; right: 30px; color: var(--primary); font-size: 40px; cursor: pointer; }

/*============ENDS==================*/

  
  #fileError {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 10px;
    font-weight: 500;
  }