body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-y: auto;
  background-color: #f5f5f5;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

.container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
}

.logo {
  width: 24px;
  height: 24px;
}

h1 {
  font-size: 24px;
  margin: 0;
  color: #2c3e50;
  flex: 1;
}

body.dark h1 {
  color: #e0e0e0;
}

#themeToggle {
  padding: 8px 16px;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#themeToggle:hover {
  background: #2980b9;
}

body.dark #themeToggle {
  background: #4a90e2;
}

.mode-toggle {
  margin-bottom: 15px;
}

#gradientModeToggle {
  width: 100%;
  padding: 10px;
  border: none;
  background: #2ecc71;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#gradientModeToggle:hover {
  background: #27ae60;
}

body.dark #gradientModeToggle {
  background: #27ae60;
}

body.dark #gradientModeToggle:hover {
  background: #219653;
}

.tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: #e0e0e0;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.tab.active {
  background: #3498db;
  color: white;
}

.tab:hover {
  background: #d0d0d0;
}

body.dark .tab {
  background: #3a3a3a;
}

body.dark .tab.active {
  background: #4a90e2;
}

body.dark .tab:hover {
  background: #4a4a4a;
}

.color-code {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
  background-color: transparent;
}

.color-swatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMElEQVR4Xu3NMQ0AAAgDMJ3/Ae9u5gP2GfBtwzCtCAMBAQEBAQEBAQEBAQEBAY5/AbwBLoD2W3xDAAAAAElFTkSuQmCC') repeat;
  background-size: 16px 16px;
  z-index: -1;
}

body.dark .color-swatch {
  border-color: #555;
}

.color-code input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 16px;
  background: white;
}

body.dark .color-code input {
  border-color: #555;
  background: #2a2a2a;
  color: #e0e0e0;
}

.color-code button {
  padding: 10px 16px;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 16px;
}

.color-code button:hover {
  background: #2980b9;
}

body.dark .color-code button {
  background: #4a90e2;
}

body.dark .color-code button:hover {
  background: #357abd;
}

.picker-options {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: flex-end;
}

.picker-options label {
  font-size: 16px;
}

body.dark .picker-options label {
  color: #e0e0e0;
}

.picker-options select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  background: white;
}

body.dark .picker-options select {
  border-color: #555;
  background: #2a2a2a;
  color: #e0e0e0;
}

.picker-container {
  margin-bottom: 15px;
  padding: 0;
}

.transparency-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.transparency-control input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.transparency-control label {
  font-size: 16px;
  color: #2c3e50;
}

body.dark .transparency-control label {
  color: #e0e0e0;
}

.gradient-container {
  margin-bottom: 15px;
}

.gradient-presets {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gradient-presets label {
  font  font-size: 16px;
  color: #2c3e50;
}

body.dark .gradient-presets label {
  color: #e0e0e0;
}

.gradient-presets select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  background: white;
}

body.dark .gradient-presets select {
  border-color: #555;
  background: #2a2a2a;
  color: #e0e0e0;
}

.gradient-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gradient-controls label {
  font-size: 16px;
  color: #2c3e50;
}

body.dark .gradient-controls label {
  color: #e0e0e0;
}

.gradient-controls select,
.gradient-controls input[type="range"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  background: white;
}

body.dark .gradient-controls select,
body.dark .gradient-controls input[type="range"] {
  border-color: #555;
  background: #2a2a2a;
  color: #e0e0e0;
}

.gradient-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.stop-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stop-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background-color: transparent;
}

.stop-swatch.selected {
  border: 2px solid #3498db;
}

.stop-swatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMElEQVR4Xu3NMQ0AAAgDMJ3/Ae9u5gP2GfBtwzCtCAMBAQEBAQEBAQEBAQEBAY5/AbwBLoD2W3xDAAAAAElFTkSuQmCC') repeat;
  background-size: 16px 16px;
  z-index: -1;
}

body.dark .stop-swatch {
  border-color: #555;
}

.stop-position {
  width: 70px;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

body.dark .stop-position {
  border-color: #555;
  background: #2a2a2a;
  color: #e0e0e0;
}

.remove-stop {
  padding: 6px 10px;
  border: none;
  background: #e74c3c;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.remove-stop:hover {
  background: #c0392b;
}

body.dark .remove-stop {
  background: #c0392b;
}

body.dark .remove-stop:hover {
  background: #a93226;
}

#addStop {
  padding: 8px 16px;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 10px;
}

#addStop:hover {
  background: #2980b9;
}

body.dark #addStop {
  background: #4a90e2;
}

body.dark #addStop:hover {
  background: #357abd;
}

.gradient-preview {
  position: relative;
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMElEQVR4Xu3NMQ0AAAgDMJ3/Ae9u5gP2GfBtwzCtCAMBAQEBAQEBAQEBAQEBAY5/AbwBLoD2W3xDAAAAAElFTkSuQmCC') repeat;
  background-size: 16px 16px;
}

.stop-marker {
  position: absolute;
  bottom: -5px;
  width: 12px;
  height: 12px;
  background-color: #fff;
  border: 1px solid #000;
  cursor: move;
  z-index: 1;
}

.history-container {
  margin-bottom: 15px;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.history-container h2 {
  font-size: 18px;
  margin: 0;
  color: #2c3e50;
}

body.dark .history-container h2 {
  color: #e0e0e0;
}

.history-controls {
  margin-bottom: 10px;
}

#clearHistory {
  padding: 8px 16px;
  border: none;
  background: #e74c3c;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#clearHistory:hover {
  background: #c0392b;
}

body.dark #clearHistory {
  background: #c0392b;
}

body.dark #clearHistory:hover {
  background: #a93226;
}

.history-message {
  font-size: 14px;
  color: #666;
  margin: 0;
}

body.dark .history-message {
  color: #aaa;
}

#colorHistory {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 40px;
}

.history-swatch {
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  background-color: transparent;
}

.history-swatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMElEQVR4Xu3NMQ0AAAgDMJ3/Ae9u5gP2GfBtwzCtCAMBAQEBAQEBAQEBAQEBAY5/AbwBLoD2W3xDAAAAAElFTkSuQmCC') repeat;
  background-size: 16px 16px;
  z-index: -1;
}

.history-swatch:focus {
  outline: 2px solid #3498db;
}

body.dark .history-swatch {
  border-color: #555;
}

body.dark .history-swatch:focus {
  outline-color: #4a90e2;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.footer-bottom {
  display: flex;
  justify-content: center;
}

.footer-button {
  flex: 1;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 16px;
  color: white;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-button.coffee {
  background: #f1c40f;
}

.footer-button.coffee:hover {
  background: #e0b309;
}

body.dark .footer-button.coffee {
  background: #d4ac0d;
}

body.dark .footer-button.coffee:hover {
  background: #b7950b;
}

.footer-button.x {
  background: #000000;
}

.footer-button.x:hover {
  background: #333333;
}

body.dark .footer-button.x {
  background: #1a1a1a;
}

body.dark .footer-button.x:hover {
  background: #4d4d4d;
}

.footer-button.chrome-extension {
  background: #4285f4; /* Google Chrome blue */
  padding: 0; /* Remove padding to let the image control size */
  flex: none;
  max-width: 100%;
}

.footer-button.chrome-extension:hover {
  background: #3267d6;
}

body.dark .footer-button.chrome-extension {
  background: #3b78e7;
}

body.dark .footer-button.chrome-extension:hover {
  background: #2a5db0;
}

.chrome-extension-img {
  width: 100%;
  height: auto;
  max-height: 40px; /* Adjust based on your image size */
  display: block;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 20px;
  }

  .logo {
    width: 20px;
    height: 20px;
  }

  #themeToggle,
  #gradientModeToggle,
  .color-code button,
  #addStop,
  #clearHistory {
    font-size: 14px;
    padding: 8px 12px;
  }

  .tab {
    font-size: 14px;
    padding: 8px;
  }

  .color-swatch,
  .stop-swatch {
    width: 28px;
    height: 28px;
  }

  .history-swatch {
    width: 36px;
    height: 36px;
  }

  .color-code input {
    font-size: 14px;
    padding: 8px;
  }

  .picker-options select,
  .gradient-presets select,
  .gradient-controls select {
    font-size: 14px;
    padding: 6px;
  }

  .footer-button {
    font-size: 14px;
    padding: 8px;
  }

  .chrome-extension-img {
    max-height: 32px; /* Smaller for mobile */
  }

  .footer-top {
    flex-direction: column;
    gap: 8px;
  }

  .footer-button {
    width: 100%;
  }
}