/* style.css (Extracted from index.html <style> block) */

/* Base Layout Styles */
html, body {
overflow: hidden;
height: 100%;
width: 100%;
font-family: 'Inter', system-ui, "Segoe UI", Arial, sans-serif;
}

#main-content-wrapper {
overflow-y: auto;
overflow-x: hidden;
height: 100%; 
width: 100%;
}

#page-container {
overflow: auto;
height: 100%;
width: 100%;
}
  /* ========== MEV Wiki Style (Hardened) ========== */
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: system-ui, "Segoe UI", Arial, sans-serif;
    background: #fff;
    color: #000;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  header {
    background: #3366cc;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    border-radius: 0 0 8px 8px;
  }
  #menu-btn {
    font-size: 28px;
    background: transparent;
    color: white;
    border: none;
    margin-right: 15px;
    cursor: pointer;
    border-radius: 4px;
    padding: 5px 8px;
    transition: background-color 0.2s;
  }
  #menu-btn:hover { background-color: rgba(255, 255, 255, 0.1); }

  #menu-btn:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #ffcc00;
    outline-offset: 2px;
  }
  /* ADDED CSP-SAFE HIDDEN CLASS */
  .hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
  .noselect { user-select: none; }
  .readonly { pointer-events: none; user-select: none; opacity: 0.6; }
  header h1 { margin: 0; font-size: 1.5rem; }

  #banner {
    background: #ffcc00;
    color: #000;
    padding: 10px;
    text-align: center;
    display: none;
    font-weight: bold;
  }

  #container {
    display: flex;
    flex-direction: row;
    /* Adjusted height to account for header and footer */
    height: calc(100vh - 120px); 
  }
  #sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    padding: 10px;
    /* MODIFICATION: Change display: none to display: block to show menu by default */
    display: block; 
    flex-shrink: 0;
  }
  #sidebar h3 { margin-top: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
  #sidebar ul { list-style: none; padding: 0; }
  #sidebar li { margin: 5px 0; border-radius: 4px; padding: 2px 0; }
  #sidebar a {
    color: #3366cc;
    text-decoration: none;
    word-break: break-word;
    display: block;
    padding: 4px 6px;
  }
  #sidebar a:hover { background-color: #e9ecef; border-radius: 4px; }
  
  /* Main Content Area - RENAME for clarity */
  #main-content-wrapper {
    flex: 1 1 100%;
    padding: 20px;
    overflow-y: auto;
  }
  #ai-bar {
    /* Search/Voice bar integrated into header */
    flex-grow: 1; 
    margin-left: 15px; 
    display: flex;
    align-items: center;
  }
#ai-input {
flex: 1;
padding: 8px 12px;
font-size: 1rem;
border-radius: 6px;
border: 1px solid #ccc;
min-width: 150px;
}

#ai-button {
margin-left: 8px;
padding: 8px 15px;
font-size: 1rem;
border-radius: 6px;
border: none;
background: #ffcc00;
color: #000;
cursor: pointer;
font-weight: bold;
transition: background-color 0.2s;
}
  #ai-button:hover { background: #e0b300; }

  section.page { margin-bottom: 40px; padding: 10px; border-radius: 8px; background-color: #fefefe; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
  section.page h2 {
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
  }
  section.page .content {
    margin-top: 10px;
    white-space: pre-wrap;
  }
  textarea.editor {
    width: 100%;
    height: 200px;
    padding: 10px;
    font-size: 16px;
    font-family: monospace;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    margin-top: 10px;
  }
  .edit-btn, .delete-btn {
    background: #3366cc;
    color: white;
    border: none;
    padding: 8px 15px;
    margin-top: 15px;
    margin-right: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
  }
  .edit-btn:hover { background-color: #254a9e; }
  .delete-btn { background-color: #cc3333; }
  .delete-btn:hover { background-color: #a60000; }

  footer {
    height: 60px;
    background: #f1f1f1;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-radius: 8px 8px 0 0;
    /* FIX CONTRAST: Ensure all general footer text is dark enough */
    color: #333333; 
  }

  /* FIX CONTRAST: Status indicator color was #555 (too light) */
  #status-indicator { font-size: 14px; color: #333333; font-weight: 600;}
  
  #ticker { white-space: nowrap; overflow: hidden; width: 100%; position: relative; margin: 0 15px; }
  #ticker span {
    display: inline-block; padding-left: 100%; animation: scroll-left 20s linear infinite;
  }
  @keyframes scroll-left { 0% { transform: translateX(0%); } 100% { transform: translateX(-100%); } }

  #storage-bar {
    margin-top: 15px;
    background: #e9ecef;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
  }
  #storage-bar-inner {
    height: 10px;
    background: #3366cc;
    width: 0%;
    transition: width 0.5s;
  }

  /* Modal Styling */
  .modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
  }
  .modal-box {
    background: white;
    max-width: 90%;
    width: 400px;
    margin: 10vh auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: left;
  }
  .modal-actions { margin-top: 20px; text-align: right; }
  .modal-actions button { margin-left: 10px; }

  /* Dark Mode */
  body.dark {
    background: #121212;
    color: #e0e0e0;
  }
  body.dark header { background: #1f1f1f; }
  body.dark #sidebar {
    background: #1c1c1c;
    border-right: 1px solid #444;
  }
  body.dark #sidebar h3 { border-bottom-color: #333; }
  body.dark #sidebar a { color: #80bfff; }
  body.dark #sidebar a:hover { background-color: #2c2c2c; }
  body.dark #main-content-wrapper { background: #181818; }
  body.dark #ai-input {
    background: #2c2c2c; color: #e0e0e0; border: 1px solid #555;
  }
  body.dark #ai-button {
    background: #665500;
    color: #fff;
  }
  body.dark #ai-button:hover {
    background: #776600;
  }
  body.dark section.page { background-color: #1f1f1f; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
  body.dark textarea, body.dark input {
    background: #2c2c2c; color: #e0e0e0; border: 1px solid #555;
  }
  body.dark .modal-box { background: #1f1f1f; }
  body.dark .edit-btn, body.dark .delete-btn {
    background: #444;
  }
  body.dark #storage-bar {
    background: #333; border-color: #555;
  }
  body.dark #storage-bar-inner {
    background: #80bfff;
  }
  body.dark footer {
    background: #181818; border-top: 1px solid #444;
  }
  body.dark #status-indicator {
    /* Ensure status indicator text is visible in dark mode, inheriting body color or setting explicitly */
    color: #e0e0e0; 
  }

  #page-container {
    display: block;
    width: 100%;
    height: auto;
    min-height: calc(100vh - 160px);
    padding: 0 10px 30px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    word-break: break-word;
    background-color: inherit;
    color: inherit;
  }
  body.dark #page-container {
    background-color: #181818;
    color: #e0e0e0;
  }
  #offline-message {
    display: none;
    background: #ffcc00;
    color: #000;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    font-family: inherit;
    z-index: 9999;
    border-bottom: 1px solid #aaa;
    position: relative;
  }
  body.dark #offline-message {
    background: #665500;
    color: #fff;
    border-bottom-color: #333;
  }
  .semantic-status {
    margin-top: 15px;
    color: green;
    font-weight: bold;
    font-size: 0.95em;
  }

  /* Styles for Quick Filter Buttons (New Component) */
  #quick-filters {
    list-style: none;
    padding: 0;
    margin-top: 10px;
  }
  /* .titleInput class is used by JS for filtering, applying to the LI */
  .titleInput button {
    background: #e9ecef; 
    border: 1px solid #ccc;
    padding: 6px 10px;
    margin-top: 5px;
    border-radius: 4px;
    cursor: pointer;
    display: block; 
    width: 100%;
    text-align: left;
    color: #3366cc;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
  }
  .titleInput button:hover {
    background: #d4d8db;
  }
  body.dark .titleInput button {
    background: #2c2c2c;
    color: #80bfff;
    border-color: #555;
  }
  body.dark .titleInput button:hover {
    background: #3c3c3c;
  }

  @media (max-width: 600px) {
    header {
      padding: 10px;
    }
    #ai-bar {
      margin-left: 10px;
    }
    #ai-input {
      font-size: 0.9rem;
      padding: 6px 10px;
    }
    #ai-button {
      padding: 6px 10px;
      font-size: 0.9rem;
    }
    #sidebar {
      width: 100%;
      position: fixed;
      height: calc(100vh - 50px);
      top: 50px;
      left: 0;
      z-index: 900;
    }
    #container {
      height: calc(100vh - 120px);
    }
    #main-content-wrapper {
      padding: 10px;
    }
  }
  /* ==================================================== */
  /* STYLES FOR INITIAL FIND VIEW (From find.html) */
  /* ==================================================== */
  #find-view {
      /* MODIFICATION: Hide by default. JS will show/hide as needed. */
      display: none; 
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 90%;
      max-width: 600px;
      z-index: 999;
      /* Inherit Dark Mode colors */
      background-color: inherit; 
      color: inherit;
  }
  #filterInput-find {
      width: 100%;
      padding: 15px;
      margin-bottom: 20px;
      font-size: 1.2em;
      border-radius: 8px;
      border: 1px solid #555;
      box-sizing: border-box;
      background-color: #f8f9fa;
      color: #000;
  }
  body.dark #filterInput-find {
      background-color: #2c2c2c;
      color: #e0e0e0;
      border: 1px solid #555;
  }
  #page-list-find {
      list-style: none;
      padding: 0;
      margin: 0;
      max-height: 40vh; /* Limit height for long lists */
      overflow-y: auto;
  }
  .titleInput-find {
      margin: 5px 0;
      animation: fadeIn 0.5s ease-in-out;
  }
  .titleInput-find button {
      width: 100%;
      padding: 12px;
      text-align: left;
      background-color: #3366cc;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      font-size: 1.0em;
      transition: background-color 0.2s;
  }
  .titleInput-find button:hover {
      background-color: #254a9e;
  }
  body.dark .titleInput-find button {
      background-color: #444;
  }
  body.dark .titleInput-find button:hover {
      background-color: #555;
  }
  /* FIX CONTRAST: Status message color was #888 (failed contrast) */
  #status-message-find { color: #444444; margin-top: 10px; text-align: center; font-size: 0.9em; }

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

