:root {
    --bg-light: linear-gradient(to right, #eef2f3, #8e9eab);
    --bg-dark: #121212;
    --container-light: #fff;
    --container-dark: #1e1e1e;
    --text-light: #333;
    --text-dark: #eee;
    --border-dark: #444;
    --highlight-dark: #2c2c2c;
  }
  
  body {
    font-family: var(--font-body);
    padding: 20px;
    background: var(--bg-light);
    color: var(--text-light);
    transition: all 0.3s ease;
  }
  
  body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
  }
  
  .container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--container-light);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: background 0.3s;
  }
  
  body.dark-mode .container {
    background: var(--container-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
  
  .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
  }
  
  h2 {
    margin: 0;
    font-weight: 600;
    flex: 1 1 auto;
  }
  
  .actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
  }
  
  .generate-btn {
    background: #007bff;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
  }
  
  .generate-btn:hover {
    background: #0056b3;
  }
  
  .toggle-dark {
    background: #555;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    position: relative;
    animation: fadeIn 0.3s ease-in;
    transition: background 0.3s, border 0.3s;
  }
  
  body.dark-mode .form-group {
    background-color: var(--highlight-dark);
    border-color: var(--border-dark);
  }
  
  .form-group:not(:first-child)::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #64b5f6;
  }
  
  body.dark-mode .form-group:not(:first-child)::before {
    background-color: var(--border-dark);
  }
  
  .form-group label {
    font-weight: 600;
    margin-bottom: 5px;
  }
  
  .form-group input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #000;
  }
  
  body.dark-mode .form-group input {
    background: #2c2c2c;
    color: #fff;
    border-color: #555;
  }
  
  .btn-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }
  
  .btn {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  
  .btn:hover {
    background: #1e7e34;
  }
  
  /* Modal styles for manifest preview */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
  }
  .modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 10px;
    position: relative;
  }
  .close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  .close:hover,
  .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
  }
  .preview-btn {
    background: #ff9800;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin-left: 10px;
  }
  .preview-btn:hover {
    background: #e65100;
  }
  
  body.dark-mode .modal-content {
    background-color: #23272e;
    color: #eee;
    border-color: #444;
  }
  body.dark-mode .close {
    color: #eee;
  }
  body.dark-mode .close:hover,
  body.dark-mode .close:focus {
    color: #fff;
  }
  #manifestCode {
    background: #23272e;
    color: #e0e0e0;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', monospace;
    font-size: 1.05em;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow-x: auto;
    margin: 0;
    line-height: 1.6;
    max-height: 60vh;
  }
  body.dark-mode #manifestCode {
    background: #181a1b;
    color: #e0e0e0;
    border-color: #333;
  }
  
  .form-collapsible {
    border: 1px solid #90caf9;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #e3f2fd;
    transition: background 0.3s, border 0.3s;
  }
  body.dark-mode .form-collapsible {
    background: var(--highlight-dark);
    border-color: var(--border-dark);
  }
  .form-collapsible-header {
    font-weight: 600;
    padding: 12px 18px;
    border-bottom: 1px solid #90caf9;
    display: flex;
    align-items: center;
    user-select: none;
    background: #bbdefb;
    border-radius: 8px 8px 0 0;
    transition: background 0.3s;
  }
  body.dark-mode .form-collapsible-header {
    background: #23272e;
    border-bottom: 1px solid #444;
  }
  .form-collapsible-header .toggle-arrow {
    font-size: 1.2em;
    margin-right: 10px;
    transition: transform 0.2s;
  }
  .form-collapsible .form-group {
    padding: 20px;
    margin: 0;
    border: none;
    border-radius: 0 0 8px 8px;
    background: none;
    animation: none;
  }
  
  .tooltip-hint {
    position: relative;
    display: inline-block;
    cursor: pointer;
  }
  .hint-icon {
    font-size: 1em;
    color: #888;
    margin-left: 4px;
    vertical-align: middle;
  }
  .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 7px 12px;
    position: absolute;
    z-index: 10;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
  }
  .tooltip-hint:hover .tooltip-text,
  .tooltip-hint:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }