/* Reset some default styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: "Segoe UI", sans-serif;
    background: #f9fafb;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    padding-top: 70px !important;
    position: relative;
  }
  
  .container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem;
    text-align: center;
  }
  
  .header {
    margin-bottom: 2rem;
  }
  
  .header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }
  
  .header p {
    font-size: 1.2rem;
    color: #666;
  }
  
  /* Grid layout for navigation */
  .nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    justify-items: center;
  }
  
  /* Tile styles */
  .nav-tile {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .nav-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: #f0f8ff;
  }
  
  .nav-tile .icon {
    width: 2rem;
    height: 2rem;
  }
  
  .nav-tile span {
    display: block;
  }
  
  /* ============ Toggle switch ============ */
.theme-toggle {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    background-color: var(--tile-background, #ffffff);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
  }
  
  .switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 34px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.4s;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
  }
  
  input:checked + .slider {
    background-color: #4f46e5;
  }
  
  input:checked + .slider:before {
    transform: translateX(24px);
  }
  
  /* ============ Dark mode styles ============ */
  body.dark {
    background-color: #1a1b1e;
    color: #f1f1f1;
  }
  
  body.dark .header p {
    color: #aaa;
  }
  
  body.dark .nav-tile {
    background-color: #2a2b2f;
    border-color: #444;
    color: #f1f1f1;
  }
  
  body.dark .nav-tile:hover {
    background-color: #333a4a;
  }
  
  body.dark .nav-tile .icon {
    color: #f1f1f1;
  }

  
  .footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
  }
  
  .footer-links {
    margin-top: 0.5rem;
  }
  
  .footer-links a {
    margin: 0 0.5rem;
    text-decoration: none;
    color: inherit;
  }
  
  .footer-links a:hover {
    text-decoration: underline;
  }
  
  body.dark .footer {
    border-top-color: #333;
  }
  
  .theme-label {
    user-select: none; /* Prevents text selection */
  }
  
  /* Back button styles */
  .back-button {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 1000 !important;
    background-color: var(--tile-background, #ffffff);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 !important;
  }
  
  .back-button a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    font-weight: 500;
  }
  
  .back-button a:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }
  
  .back-button .icon {
    width: 1.2rem;
    height: 1.2rem;
  }
  
  body.dark .back-button a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  /* Add these responsive styles to the existing style.css */

  /* General responsive adjustments */
  @media (max-width: 768px) {
    body {
      padding: 1rem;
    }

    .container {
      padding: 0 0.5rem;
    }

    .header h1 {
      font-size: 2rem;
    }

    .header p {
      font-size: 1rem;
      padding: 0 1rem;
    }

    .nav-grid {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 1rem;
    }

    .nav-tile {
      padding: 1rem;
      font-size: 0.9rem;
      max-width: 100%;
    }

    .theme-toggle, .back-button {
      top: 10px !important;
      padding: 6px 10px;
    }
    
    .theme-toggle {
      right: 10px !important;
    }
    
    .back-button {
      left: 10px !important;
    }
    
    .theme-label {
      display: none; /* Hide the "Dark Mode" text on small screens */
    }
  }

  /* Mobile-specific adjustments */
  @media (max-width: 480px) {
    .theme-toggle, .back-button {
      padding: 4px 8px;
    }

    .back-button span {
      display: none; /* Hide the "Back to Tools" text on very small screens */
    }

    /* Form controls for calculators */
    input, select, button {
      width: 100%;
      margin-bottom: 0.5rem;
    }

    /* Table responsiveness */
    table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }

    /* Chart responsiveness */
    canvas {
      max-width: 100%;
      height: auto !important;
    }

    /* Results display */
    .result-box {
      padding: 0.75rem;
      font-size: 0.9rem;
    }

    /* Image converter specific */
    .preview {
      gap: 10px;
    }

    .card {
      width: 100%;
      max-width: none;
    }

    #dropZone {
      padding: 20px;
      margin: 10px;
    }

    /* TDEE calculator specific */
    .tabs button {
      padding: 0.25rem 0.5rem;
      font-size: 0.9rem;
    }

    .horizontal-radio {
      flex-wrap: wrap;
    }

    /* Tip calculator specific */
    .tip-buttons {
      gap: 5px;
    }

    .tip-buttons button {
      padding: 8px;
      font-size: 0.9rem;
    }

    body {
      padding-top: 60px;
    }
  }

  /* Tablet adjustments */
  @media (min-width: 481px) and (max-width: 1024px) {
    .container {
      max-width: 90%;
    }

    .nav-grid {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .nav-tile {
      max-width: 200px;
    }
  }

  /* Ensure forms are more usable on mobile */
  @media (max-width: 768px) {
    .form-group {
      margin-bottom: 1rem;
    }

    label {
      margin-bottom: 0.25rem;
      display: block;
    }

    input[type="number"],
    input[type="text"],
    select {
      font-size: 16px; /* Prevents iOS zoom on focus */
      padding: 8px;
    }

    button {
      min-height: 44px; /* Better touch targets */
    }
  }

  /* Fix for dark mode on mobile */
  @media (max-width: 768px) {
    body.dark .nav-tile {
      background-color: #2a2b2f;
    }

    body.dark .result-box {
      background-color: #2a2b2f;
    }

    body.dark input,
    body.dark select {
      background-color: #2a2b2f;
      color: #f1f1f1;
      border-color: #444;
    }
  }
  
  /* For very small screens */
  @media (max-width: 480px) {
    .theme-toggle, .back-button {
      padding: 4px 8px;
    }
    
    .back-button span {
      display: none; /* Hide the "Back to Tools" text on very small screens */
    }
  }
  
  /* Base styles */
:root {
    --primary-color: #007bff;
    --background-color: #ffffff;
    --text-color: #333333;
    --tile-background: #f8f9fa;
    --tile-hover: #e9ecef;
    --border-color: #dee2e6;
}

body.dark {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --tile-background: #2d2d2d;
    --tile-hover: #3d3d3d;
    --border-color: #404040;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin-bottom: 1rem;
}

/* Navigation grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--tile-background);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, background-color 0.3s;
}

.nav-tile:hover {
    transform: translateY(-5px);
    background-color: var(--tile-hover);
}

/* Theme toggle styles */
.theme-toggle {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    background-color: var(--tile-background, #ffffff);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
  }
  
  .switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 34px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.4s;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
  }
  
  input:checked + .slider {
    background-color: #4f46e5;
  }
  
  input:checked + .slider:before {
    transform: translateX(24px);
  }
  
  /* Footer styles */
  .footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--tile-background);
    margin-top: 2rem;
  }
  
  .footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .footer-links a {
    color: var(--text-color);
    text-decoration: none;
  }
  
  /* Calculator specific styles */
  .calculator-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--tile-background);
    border-radius: 8px;
  }
  
  .input-group {
    margin-bottom: 1rem;
  }
  
  .input-group label {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .input-group input,
  .input-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
  }
  
  .calculator-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
  }
  
  .calculator-btn:hover {
    opacity: 0.9;
  }
  
  #result {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 4px;
  }
  
  /* Add these styles for the compound interest calculator */
  canvas {
    margin-top: 30px;
    width: 100%;
  }
  
  table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
  }
  
  th, td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: right;
  }
  
  th {
    background: var(--tile-background);
    text-align: center;
  }
  
  #result {
    margin-top: 25px;
    padding: 15px;
    background: var(--tile-background);
    border-radius: 8px;
  }
  
  /* Additional styles for the compound interest calculator */
  .form-group input, 
  .form-group select {
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
  }
  
  .form-group input:focus, 
  .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  /* Ensure table styles are properly defined */
  table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
  }
  
  th, td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: right;
  }
  
  th {
    background-color: var(--tile-background);
    text-align: center;
    font-weight: bold;
  }
  
  body.dark th {
    background-color: var(--tile-background);
  }
  
  /* Ensure canvas is properly styled */
  canvas {
    margin-top: 30px;
    width: 100%;
    max-height: 400px;
  }
  
  /* Additional styles for image converter */
  .preview {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }
  
  .card {
    background-color: var(--tile-background);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
  }
  
  .card:hover {
    transform: translateY(-5px);
  }
  
  .card img {
    max-width: 100%;
    border-radius: 6px;
  }
  
  #dropZone {
    border: 3px dashed var(--primary-color);
    border-radius: 10px;
    padding: 40px;
    background-color: var(--tile-background);
    color: #888;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  #dropZone.dragover {
    background-color: rgba(75, 192, 192, 0.1);
    color: var(--primary-color);
  }
  
  #progressBar {
    width: 60%;
    margin: 20px auto;
    background-color: var(--border-color);
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
  }
  
  #progressBarFill {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
  }
  
  /* FAQ Component Styles */
  .faq-section {
    margin-top: 60px;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  .faq-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.8rem;
  }
  
  .faq-section h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
  }
  
  .faq-section p {
    line-height: 1.6;
    margin-bottom: 15px;
  }
  
  .faq-section ul {
    padding-left: 20px;
    margin-bottom: 20px;
  }
  
  .faq-section li {
    margin-bottom: 8px;
    line-height: 1.5;
  }
  
  .faq-section strong {
    color: var(--primary-color);
  }
  
  /* Responsive adjustments for FAQ section */
  @media (max-width: 768px) {
    .faq-section {
      padding: 20px;
      margin-top: 40px;
    }
    
    .faq-section h2 {
      font-size: 1.5rem;
    }
    
    .faq-section h3 {
      font-size: 1.2rem;
    }
  }
  
  /* Password generator specific styles */
  .password-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
  }
  
  .options label {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .password-btn {
    padding: 12px;
    width: 100%;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s;
  }
  
  .password-btn:hover {
    opacity: 0.9;
  }
  
  #password {
    font-family: monospace;
    padding: 12px;
    background: var(--tile-background);
    border: 1px solid var(--border-color);
    width: 100%;
    margin-top: 10px;
    word-break: break-word;
    border-radius: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  
  #strength {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
    color: var(--text-color);
  }
  
  /* Accordion Component Styles */
  .accordion-item {
    margin-bottom: 16px;
  }
  
  .accordion-header {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 12px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .accordion-header::after {
    content: "\25BC"; /* downward chevron */
    font-size: 12px;
    transition: transform 0.3s ease;
  }
  
  .accordion-item.active .accordion-header::after {
    transform: rotate(180deg);
  }
  
  .accordion-body {
    padding: 10px 15px;
    display: none;
    background-color: var(--tile-background);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-top: 8px;
  }
  
  .accordion-item.active .accordion-body {
    display: block;
  }
  
  /* Percentage calculator specific styles */
  .calculator-section {
    background: var(--tile-background);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  .calculator-section label {
    flex: 2;
    min-width: 300px;
  }
  
  .calc-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    flex: 0;
    white-space: nowrap;
    transition: opacity 0.3s;
  }
  
  .calc-button:hover {
    opacity: 0.9;
  }
  
  .result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--tile-background);
    color: var(--text-color);
    font-weight: bold;
    min-width: 100px;
    height: 42px;
    text-align: center;
    flex: 0;
    white-space: nowrap;
  }
  
  /* TDEE Calculator Styles */
  .tdee-container {
    max-width: 600px;
    width: 100%;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .tabs button {
    padding: 0.5rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s;
  }
  
  .tabs button.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
  }
  
  .horizontal-radio {
    display: flex;
    gap: 1rem;
    align-items: center;
  }
  
  .calculate-btn {
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
    width: 100%;
  }
  
  .calculate-btn:hover {
    opacity: 0.9;
  }
  
  /* Tip Calculator Styles */
  .tip-container {
    max-width: 420px;
    margin: 40px auto;
    padding: 24px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .tip-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .tip-buttons button {
    flex: 1;
    min-width: 60px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  
  .tip-buttons button:hover {
    opacity: 0.9;
  }
  
  .controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }
  
  .controls button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  
  .controls button:hover {
    opacity: 0.9;
  }
  
  .tip-result {
    background-color: var(--tile-background-alt);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
  }
  
  .tip-result p {
    margin: 10px 0;
    font-size: 1.2em;
  }
  
  /* EV vs Petrol vs Diesel Calculator Styles */
  .ev-container {
    max-width: 960px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 40px;
  }
  
  .ev-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
  }
  
  .card {
    background-color: var(--tile-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: background 0.3s, border-color 0.3s;
  }
  
  .grid {
    display: grid;
    gap: 20px;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  @media (max-width: 700px) {
    .grid-2, .grid-3 {
      grid-template-columns: 1fr;
    }
  }
  
  /* Ensure dark mode compatibility */
  body.dark .theme-toggle,
  body.dark .back-button {
    background-color: var(--tile-background, #2a2b2f);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Running Pace Calculator Styles */
  .pace-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .pace-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
  }
  
  #chart {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.5rem 1rem;
    background: var(--tile-background-alt);
    padding: 1rem;
    border-radius: 0.75rem;
    font-family: monospace;
  }
  
  .chart-header {
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
  }
  
  .chart-cell {
    padding: 0.25rem 0;
  }
  
  .export-btn {
    margin-top: 1.5rem;
    padding: 0.5rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s, color 0.3s;
  }
  
  .export-btn:hover {
    background-color: var(--primary-color);
    color: white;
  }
  
  .toggle-mode {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  /* Cooking Quantity Calculator Styles */
  .cooking-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .cooking-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
  }
  
  .cooking-container p {
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }
  
  .button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
  }
  
  .button-row button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
  }
  
  .primary-btn {
    background-color: var(--primary-color);
    color: white;
  }
  
  .secondary-btn {
    background-color: var(--secondary-color);
    color: white;
  }
  
  .danger-btn {
    background-color: #e74c3c;
    color: white;
  }
  
  .ingredient {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
  }
  
  .ingredient input,
  .ingredient select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--tile-background);
    color: var(--text-color);
  }
  
  .ingredient span {
    font-weight: bold;
    color: var(--primary-color);
  }
  
  .ingredient button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
  }
  
  .add-ingredient-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: var(--tile-background);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .add-ingredient-btn:hover {
    background-color: var(--tile-background-alt);
  }
  
  @media (max-width: 600px) {
    .ingredient {
      grid-template-columns: 1fr 1fr;
      grid-template-rows: auto auto;
      gap: 5px;
    }
    
    .ingredient input:first-child {
      grid-column: span 2;
    }
    
    .ingredient span {
      grid-column: span 2;
      text-align: center;
      margin: 5px 0;
    }
  }
  
  /* Unit Converter Styles */
  .converter-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--tile-background);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .converter-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
  }
  
  .convert-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
    margin-bottom: 1rem;
  }
  
  .convert-btn:hover {
    opacity: 0.9;
  }
  
  .copy-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin-top: 1rem;
    display: none;
  }
  
  .copy-btn:hover {
    background-color: var(--primary-color);
    color: white;
  }
  
  .result {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--tile-background-alt);
    border-radius: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
  }
  
  /* Responsive grid layout for larger screens */
  @media (min-width: 768px) {
    .conversion-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }
  }
  
  /* Dinosaur Game Styles */
  .game-container {
    margin: 40px auto;
    text-align: center;
    max-width: 1000px;
  }

  .game-container h2 {
    margin-bottom: 10px;
    color: var(--text-color);
  }

  .game-container p {
    margin-bottom: 20px;
    color: var(--text-color-secondary);
  }

  #dino-game {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--tile-background);
    margin-bottom: 20px;
  }

  #dino {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M15 3v3a2 2 0 0 0 2 2h3"/><path d="M3 15h3a2 2 0 0 1 2 2v3"/><path d="M21 15h-3a2 2 0 0 0-2 2v3"/><path d="M12 8v8"/><path d="M8 12h8"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    bottom: 0;
    left: 50px;
  }

  .cactus {
    position: absolute;
    width: 40px;
    height: 70px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v20M9 6.8V20M15 6.8V20"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    bottom: 0;
  }

  #ground {
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    bottom: 0;
  }

  #score, #high-score {
    position: absolute;
    top: 10px;
    font-size: 16px;
    color: var(--text-color);
  }

  #score {
    right: 100px;
  }

  #high-score {
    right: 10px;
  }

  #game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 10;
  }

  .hidden {
    display: none;
  }

  .game-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
  }

  .game-button:hover {
    opacity: 0.9;
  }

  /* Dark mode adjustments for the game */
  body.dark-mode #dino-game {
    background-color: var(--tile-background);
  }

  body.dark-mode #dino,
  body.dark-mode .cactus {
    filter: invert(1);
  }

  body.dark-mode #game-over {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
  }
  
  /* Remove search functionality styles */
  .search-container,
  .search-input,
  .search-results,
  .no-results {
    display: none;
  }
  .cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #222;
    color: #fff;
    padding: 1rem;
    font-size: 0.9rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  }
  /*CookieBanner */
  .cookie-banner.show {
    display: block;
  }
  .cookie-content {
    max-width: 800px;
    margin: 0 auto;
  }
  .cookie-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
  }
  .cookie-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .cookie-buttons button {
    margin-left: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: #00aaff;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
  }
  .cookie-buttons button:hover {
    background: #008ecc;
  }
  
  /*search bar */
  .search-bar-wrapper {
    margin: 2rem auto;
    max-width: 500px;
    position: relative;
  }
  
  #searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
  }
  
  .search-results li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
  }
  
  .search-results li:last-child {
    border-bottom: none;
  }
  
  .search-results li:hover {
    background-color: #f0f0f0;
  }

  .ad-wrapper {
    width: 100%;
    min-width: 300px;
    min-height: 100px;
    margin: 2rem auto;
    display: block;
    text-align: center;
    overflow: hidden;
  }
  
  
  .page-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    gap: 20px;
  }
  
  .main-content {
    max-width: 1200px;
    flex: 1;
  }
  
  .side-ad {
    width: 160px;
    flex-shrink: 0;
    display: block;
    margin-top: 150px;
  }
  
  @media (max-width: 480px) {
    .side-ad {
      display: none; /* Hide side ads on smaller screens */
    }
  }
    
    @media (max-width:1024px) {
      .side-ad {
      display:block; 
      width:100%; /* full-width strip */
      margin:1rem auto;
    }
  }

  @media (max-width: 768px) {
    .ad-wrapper {
      max-width: 100%;
      min-width: 300px;
      min-height: 90px;
    }
  }
  
  
  
  
  