 /* Root Variables */
 :root {
    --primary-color: #25b6d2;
    --secondary-color: #415e72;
    --accent-color: #e04f5f;
    --bg-color: #121212;
    --dropdown-bg-color: #333333;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --header-bg: linear-gradient(90deg, #25b6d2, #415e72);
    --footer-bg: #222222;
    --input-bg: #333333;
    --input-border: #555555;
    --text-color: #e0e0e0;
    --toggle-bg-color: #7b7b7b;
    --container-bg-color: #121212;
    --sidebar-background-color: #2d2c2c;
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; padding: 0; background: var(--bg-color); }
  body { font-family: 'Roboto', sans-serif; display: flex; flex-direction: column; color: var(--text-color); }
  
  header, footer { padding: 15px 20px; color: #fff; }
  header { 
    background: var(--header-bg); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    position: relative;
  }
  header h1 { margin: 0; font-size: 2em; }
  header h2 { margin: 5px 0 0; font-weight: 300; font-size: 1.2em; }
  nav { margin-top: 10px; }
  nav a { color: #fff; margin: 0 10px; text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
  nav a:hover { color: var(--accent-color); }
  
  main { flex: 1; padding: 20px; max-width: 900px; margin: 0 auto; width: 100%; }
  
  footer { 
    background: var(--footer-bg); 
    text-align: center; 
    font-size: 0.9em; 
    padding: 15px 20px;
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: center; 
    gap: 10px;
  }
  footer a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
  .github-icon { width: 24px; height: 24px; fill: #fff; }
  
  .form-group { margin-bottom: 15px; }
  .form-group label { display: block; font-weight: 500; margin-bottom: 5px; }
  #promptInput {
    width: 80%; height: 200px; padding: 10px; border: 1px solid var(--input-border);
    border-radius: 6px; font-size: 1em; resize: vertical; background: var(--input-bg); color: var(--text-color);
  }
  #iterationInput {
    width: 100px; padding: 8px; border: 1px solid var(--input-border);
    border-radius: 6px; font-size: 1em; text-align: center; background: var(--input-bg); color: var(--text-color);
  }
  #startBtn {
    padding: 10px 20px; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none; border-radius: 6px; color: #fff; font-size: 1em; cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s;
  }
  #startBtn:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
  
  #iterationLog { margin-top: 20px; padding: 20px; background: var(--bg-color); }
  .iteration-block {
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px;
    padding: 15px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); position: relative;
    animation: fadeIn 0.5s ease-in;
  }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  .copy-btn, .visualize-btn, .edit-btn {
    float: right; margin-right: 10px; cursor: pointer; margin-top: 5px;
    background: var(--primary-color); color: #fff; border: none; padding: 5px 10px; border-radius: 4px;
    transition: background 0.3s ease;
  }
  .copy-btn:hover, .visualize-btn:hover, .edit-btn:hover { background: var(--secondary-color); }
  details { margin-top: 10px; }
  summary {
    list-style: none; padding-left: 30px; position: relative; cursor: pointer; font-weight: 500;
  }
  summary::before {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 21px; height: 21px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21' xml:space='preserve' width='21' height='21'%3E%3Cpath style='fill:%2325b6d2' d='m0 10.701 7.163-3.328v1.582L1.746 11.328v0.03l5.417 2.373v1.582L0 11.985z'/%3E%3Cpath style='fill:%23415e72' d='m8.269 15.91 3.194-10.82h1.507l-3.192 10.82z'/%3E%3Cpath style='fill:%23e04f5f' d='m21 12.029-7.163 3.283v-1.582l5.537-2.373v-0.03l-5.537-2.373v-1.582L21 10.657z'/%3E%3C/svg%3E");
    background-size: cover; background-repeat: no-repeat; pointer-events: none;
  }
  .error-text { color: #d9534f; }
  .success-text { color: #5cb85c; font-weight: bold; }
  .waiting { display: inline-block; margin-left: 10px; }
  .waiting span {
    display: inline-block; width: 16px; height: 16px; background-color: blue;
    border-radius: 50%; margin: 0 4px; animation: blink 1.4s infinite both; opacity: 0.2;
  }
  .waiting span:nth-child(2) { animation-delay: 0.2s; }
  .waiting span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } }
  .code-icon { font-size: 20px; margin-left: 5px; vertical-align: middle; }
  .improvement-container { position: relative; margin-top: 15px; }
  .submit-icon {
    position: absolute; bottom: 10px; right: 10px; width: 24px; height: 24px; cursor: pointer;
  }

   /* Model Settings Menu styles (dark themed) */
.model-settings {
    background: #2a2a2a; /* dark but distinct from #121212 */
    padding: 15px;
    border: 1px solid #444; /* lighter border for contrast */
    border-radius: 8px;
    margin: 20px auto;
    max-width: 500px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
    color: #f1f1f1;
  }
  .model-settings label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #f1f1f1;
  }
  .model-settings select,
  .model-settings input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 0.9em;
    background: #1e1e1e;
    color: #f1f1f1;
  }
  
      .hidden {
        display: none;
      }
  
  /* Tooltip */
  .tooltip {
    position: relative;
    display: inline-block;
  }
  .tooltip .tooltiptext {
    visibility: hidden;
    width: 180px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9em;
  }
  .tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
  }
  .tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
  }
  
  /* Language Dropdown */
  .language-dropdown {
    position: relative;
    z-index: 1002;
  }
  .language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    margin: -2px 0 0 0;
    outline: none;
    box-shadow: none;
  }
  .language-dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--sidebar-background-color);
    border-radius: 5px;
    z-index: 1001;
    min-width: 160px;
    padding: 5px 0;
  }
  .language-dropdown.active .dropdown-content {
    display: block;
  }
  .language-dropdown .dropdown-content a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
  }
  .language-dropdown .dropdown-content a:hover {
    background-color: var(--toggle-bg-color);
  }
  .language-dropdown .dropdown-content a span {
    font-weight: bold;
  }
  
  /* Sidebar Styling (Hidden by default on both desktop and mobile) */
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 300px;
    background-color: var(--sidebar-background-color);
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
  }
  
  /* FAQ items inside Sidebar */
  .faq-question {
    color: var(--text-color);
    cursor: pointer;
    padding: 10px;
    border-bottom: 1px solid #d2d2d2;
  }
  .faq-answer {
    color: var(--text-color);
    display: none;
    padding: 10px 10px 10px 20px;
  }
  
  /* FAQ "?" Button fixed at bottom */
  .faq-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #525253;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
  }
  
  /* Header Controls (for Language Dropdown) */
  .header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 5px;
    right: 10px;
    z-index: 1002;
    flex-direction: row-reverse;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    .header-controls {
        flex-direction: row;
    }
    .language-button {
        font-size: 20px;
    }
  }
  
  /* Color classes */
  .red { color: red; }
  .yellow { color: #FFC107; }
  .black { color: black; }
  .white { color: white; }
  .blue { color: blue; }
  .green { color: green; }
