/* =========================================
     1. LIGHT MODE (DEFAULT)
     These styles force the page to be Light by default
     ========================================= */

/* =========================================
   1. LIGHT MODE (DEFAULT)
   ========================================= */

/* ... (Your existing Container styles) ... */

/* [NEW] Fix for Sidebar Buttons in Light Mode */
.lang-btn-small {
    color: #333; /* Dark Text */
    background-color: transparent; /* Remove dark background */
    transition: background 0.2s, color 0.2s;
}

.lang-btn-small:hover {
    background-color: #e2e6ea; /* Light Gray Hover */
    color: #000;
}

.lang-btn-small.active {
    background-color: #dbe2e8;
    color: #000;
    font-weight: bold;
    border-left: 3px solid #007bff; /* Optional: Highlights active tab */
}

  
  body { 
      background-color: #f4f6f9; 
      color: #333; 
      font-family: 'Segoe UI', Tahoma, sans-serif;
      margin: 0; 
      transition: background-color 0.3s, color 0.3s; 
  }

  .container { display: flex; min-height: 100vh; }

  /* Main Area Light Mode */
  .main-compiler { 
      flex-grow: 1; 
      padding: 20px 30px; 
      max-width: 1400px; 
      margin: 0 auto; 
      background-color: #ffffff; /* Explicit White */
      transition: background 0.3s; 
  }

  /* Sidebar (Inherits style.css but forces Light background) */
  .side-lang-buttons {
     background-color: #ffffff;
     border-right: 1px solid #ddd;
  }

  /* Topbar */
  .topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
  .topbar h2 { margin: 0; font-size: 1.5rem; color: #333; }
  .home-btn { color: #555; text-decoration: none; font-weight: 600; margin-right:15px; font-size: 0.9rem; }
  
  /* Inputs & Buttons */
  #exampleSelector { padding: 8px; border-radius: 4px; border: 1px solid #ccc; margin-left: 10px; cursor:pointer; background: #fff; color: #333; }
  button { padding: 10px 18px; border: none; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: 14px; transition: opacity 0.2s; }
  button:hover { opacity: 0.9; }

  /* =========================================
     2. SPLIT WORKSPACE LAYOUT
     ========================================= */
  .workspace-grid {
      display: flex;
      gap: 20px;
      margin-bottom: 20px;
      height: 500px; /* Fixed height for split view */
  }

  /* Left Column: Editor */
  /*.editor-column {
      flex: 3; 
      display: flex;
      flex-direction: column;
  }*/

  /* Right Column: Tables */
  /*.tables-column {
      flex: 1; 
      display: flex;
      flex-direction: column;
      min-width: 250px;
  }*/

  /* Left Column: Editor (60%) */
  .editor-column {
      flex: 6;  /* Changed from 3 to 6 */
      display: flex;
      flex-direction: column;
  }

  /* Right Column: Tables (40%) */
  .tables-column {
      flex: 4;  /* Changed from 1 to 4 */
      display: flex;
      flex-direction: column;
      min-width: 250px;
  }

  /* Editor Styling */
  .CodeMirror { 
      flex-grow: 1; 
      border: 1px solid #ddd; 
      border-radius: 6px; 
      font-size: 14px; 
      height: 100%; 
  }

  /* Visual Tables Container (Light Mode) */
  .visual-tables-container {
      background: #f8f9fa; border: 1px solid #ddd; border-radius: 6px;
      padding: 10px; 
      flex-grow: 1; 
      overflow-y: auto; 
      transition: background 0.3s, border-color 0.3s;
  }
  .db-table-wrapper { 
      margin-bottom: 15px; background: #fff; border: 1px solid #eee; 
      border-radius: 4px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .db-table-title {
      background: #007bff; color: white; padding: 6px 10px; font-size: 12px; font-weight: bold;
      display: flex; justify-content: space-between; align-items: center;
  }
  .visual-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .visual-table th, .visual-table td { border: 1px solid #eee; padding: 4px 8px; text-align: left; color: #444; }
  .visual-table th { background-color: #f1f1f1; font-weight: 600; color: #333; }
  
  /* Output Area (Light Mode) */
  #output { 
      background: #f8f9fa; color: #333; border: 1px solid #ddd;
      padding: 20px; border-radius: 6px; white-space: pre-wrap; font-family: 'Courier New', monospace; 
      margin-top:10px; min-height: 80px;
      transition: background 0.3s, color 0.3s, border-color 0.3s;
  }
  .output-table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 14px; background: #fff; }
  .output-table th, .output-table td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
  .output-table th { background: #e9ecef; font-weight: bold; }

  /* Info Box (Light Mode) */
  .info-box {
      margin-top: 30px; padding: 15px 20px; border-radius: 6px;
      background-color: #eef5f9; border-left: 5px solid #17a2b8; font-size: 0.9rem;
      color: #444; transition: background 0.3s, color 0.3s;
  }
  .info-box h4 { margin: 0 0 10px 0; font-size: 1rem; color: #0c5460; }
  .info-box ul { margin: 0; padding-left: 20px; }

  /* Responsive Mobile Layout */
  @media (max-width: 900px) {
      .workspace-grid { flex-direction: column; height: auto; }
      .CodeMirror { height: 350px; }
      .tables-column { max-height: 300px; }
  }

  /* =========================================
     3. DARK MODE OVERRIDES
     ========================================= */
  body.dark-mode { background-color: #121212 !important; color: #e0e0e0; }
  
  /* Force Sidebar Dark */
  body.dark-mode .side-lang-buttons { background-color: #1e1e1e; border-right-color: #333; }
  
  /* Force Main Area Dark */
  body.dark-mode .main-compiler { background-color: #1e1e1e; }
  body.dark-mode .topbar { border-bottom-color: #333; }
  body.dark-mode .topbar h2 { color: #f0f0f0; }
  body.dark-mode .home-btn { color: #aaa; }
  body.dark-mode #exampleSelector { background: #333; color: #fff; border-color: #555; }

  /* Visual Tables Dark Mode */
  body.dark-mode .visual-tables-container { background: #252526; border-color: #444; color: #f8f8f2; }
  body.dark-mode .db-table-wrapper { background: #2d2d2d; border-color: #444; }
  body.dark-mode .visual-table th { background-color: #383838; color: #f8f8f2; border-color: #555; }
  body.dark-mode .visual-table td { color: #ccc; border-color: #555; }

  /* Output Dark Mode */
  body.dark-mode #output { background: #282a36; color: #f8f8f2; border-color: #444; }
  body.dark-mode .output-table { background: transparent; }
  body.dark-mode .output-table th { background: #44475a; color: #50fa7b; border-color: #6272a4; }
  body.dark-mode .output-table td { border-color: #6272a4; color: #fff; }

  body.dark-mode .info-box { background-color: #2d2d2d; color: #ccc; border-left-color: #17a2b8; }
  body.dark-mode .info-box h4 { color: #17a2b8; }