:root {
  --primary-color: #6354A7;
  --secondary-color: #F97F1F;
  --accent-color: #5F3FA7;
  --background-dark: #1E1E1E;
  --background-darker: #121212;
  --text-light: #FFFFFF;
  --text-dim: #AAAAAA;
  --border-color: #333333;
  --panel-bg: #252525;
  --highlight: #F854A4;
  --success: #4CAF50;
  --warning: #FFC107;
  --error: #F44336;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background-dark);
  color: var(--text-light);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* App Container */
.app-container {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: var(--background-darker);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.sidebar-section {
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}

.toggle-icon {
  font-size: 16px;
  color: var(--text-dim);
}

.section-content {
  padding: 12px 0;
  display: none;
}

.sidebar-section.expanded .section-content {
  display: block;
}

.add-colors {
  margin-top: auto;
  padding: 16px 0;
}

.add-colors-btn {
  width: 100%;
  background-color: var(--border-color);
  border: none;
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
  transition: background-color 0.2s;
}

.add-colors-btn:hover {
  background-color: var(--primary-color);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Top Bar */
.topbar {
  height: 48px;
  background-color: var(--background-darker);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.left-tools, .right-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  transition: all 0.2s;
  position: relative;
}

.tool-btn:hover {
  background-color: var(--panel-bg);
  color: var(--text-light);
}

.tool-btn.active {
  background-color: var(--primary-color);
  color: white;
}

/* Inline Time Display */
.inline-time-display {
  display: none;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  margin-left: 8px;
  backdrop-filter: blur(10px);
  animation: slideInTime 0.3s ease-out;
}

.inline-time-display.show {
  display: flex;
}

.inline-time-display span {
  font-family: 'Inter', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes slideInTime {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Responsive adjustments for inline time */
@media (max-width: 768px) {
  .inline-time-display {
    padding: 4px 8px;
    margin-left: 4px;
  }

  .inline-time-display span {
    font-size: 12px;
  }
}

/* Settings Dropdown */
.settings-dropdown-container {
  position: relative;
}

.settings-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 12px;
  z-index: 1000;
  margin-top: 8px;
  display: none;
}

.settings-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background-color: var(--panel-bg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.settings-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section {
  margin-bottom: 16px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.theme-options {
  display: flex;
  gap: 8px;
}

.theme-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background-color: var(--background-darker);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-option:hover {
  background-color: var(--background-dark);
  color: var(--text-light);
}

.theme-option.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.color-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  border: none;
  background-color: var(--color);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.color-option:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: white;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Menu Dropdown */
.menu-dropdown-container {
  position: relative;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 8px 0;
  z-index: 1000;
  margin-top: 8px;
  display: none;
}

.menu-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background-color: var(--panel-bg);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.menu-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}

.menu-item:hover {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.menu-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.menu-item:hover svg {
  opacity: 1;
}

/* Light Theme Styles */
body.light-theme {
  background-color: #f5f5f5;
  color: #333333;
}

body.light-theme .topbar,
body.light-theme .sidebar {
  background-color: #ffffff;
  border-color: #e0e0e0;
}

body.light-theme .workspace-content {
  background-color: #ffffff;
}

body.light-theme .panel-bg {
  background-color: #f9f9f9;
}

body.light-theme .tool-btn,
body.light-theme .tab-btn {
  color: #666666;
}

body.light-theme .tool-btn:hover,
body.light-theme .tab-btn:hover {
  background-color: #f0f0f0;
  color: #333333;
}

body.light-theme .settings-dropdown {
  background-color: #ffffff;
  border-color: #e0e0e0;
}

body.light-theme .settings-dropdown::before {
  background-color: #ffffff;
  border-color: #e0e0e0;
}

body.light-theme .theme-option {
  background-color: #f0f0f0;
  border-color: #e0e0e0;
  color: #666666;
}

body.light-theme .theme-option:hover {
  background-color: #e5e5e5;
  color: #333333;
}

body.light-theme .settings-section h4 {
  color: #333333;
  border-color: #e0e0e0;
}

body.light-theme .menu-dropdown {
  background-color: #ffffff;
  border-color: #e0e0e0;
}

body.light-theme .menu-dropdown::before {
  background-color: #ffffff;
  border-color: #e0e0e0;
}

body.light-theme .menu-item {
  color: #333333;
}

body.light-theme .menu-item:hover {
  background-color: var(--accent);
  color: #ffffff;
}

/* Snake Game Styles */
.snake-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-header h3 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

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

.game-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-btn {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.game-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.game-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.game-score {
  display: flex;
  gap: 20px;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 16px;
}

.game-canvas-container {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

#snake-game {
  border: 3px solid var(--border);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-instructions {
  max-width: 250px;
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.game-instructions h4 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.game-instructions ul {
  color: var(--text-secondary);
  margin: 0;
  padding-left: 20px;
}

.game-instructions li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Light theme overrides for Snake game */
body.light-theme .game-header h3 {
  color: #333333;
}

body.light-theme .game-header p {
  color: #666666;
}

body.light-theme .game-score {
  color: #333333;
}

body.light-theme .game-instructions {
  background: #f8f9fa;
  border-color: #e0e0e0;
}

body.light-theme .game-instructions h4 {
  color: #333333;
}

body.light-theme .game-instructions ul {
  color: #666666;
}

body.light-theme #snake-game {
  border-color: #e0e0e0;
}

/* Snake Game Fullscreen Styles */
.snake-game-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.snake-game-fullscreen .game-header {
  margin-bottom: 20px;
}

.snake-game-fullscreen .game-header h3 {
  color: #ffffff;
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.snake-game-fullscreen .game-header p {
  color: #cccccc;
  font-size: 1.1rem;
}

.snake-game-fullscreen .game-score {
  color: #ffffff;
  font-size: 1.2rem;
  gap: 30px;
}

.snake-game-fullscreen #snake-game {
  width: min(80vw, 80vh);
  height: min(80vw, 80vh);
  max-width: 600px;
  max-height: 600px;
  border: 4px solid #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.snake-game-fullscreen .game-controls {
  margin-top: 20px;
  gap: 15px;
}

.snake-game-fullscreen .game-btn {
  padding: 12px 24px;
  font-size: 16px;
  min-width: 120px;
}

.fullscreen-game-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  z-index: 10001;
}

.fullscreen-score-display {
  display: flex;
  gap: 30px;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.fullscreen-exit-btn {
  background: rgba(255, 0, 0, 0.8);
  border: 2px solid #ffffff;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-exit-btn:hover {
  background: rgba(255, 0, 0, 1);
  transform: scale(1.1);
}

.fullscreen-controls-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive fullscreen adjustments */
@media (max-width: 768px) {
  .snake-game-fullscreen #snake-game {
    width: min(95vw, 95vh);
    height: min(95vw, 95vh);
    max-width: 500px;
    max-height: 500px;
  }

  .fullscreen-game-ui {
    padding: 10px;
  }

  .fullscreen-score-display {
    gap: 15px;
    font-size: 1rem;
    padding: 8px 15px;
  }

  .fullscreen-exit-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .fullscreen-controls-hint {
    bottom: 10px;
    gap: 20px;
    font-size: 0.8rem;
    padding: 8px 15px;
    flex-direction: column;
    text-align: center;
  }
}

/* Responsive design for Snake game */
@media (max-width: 768px) {
  .snake-game-container {
    padding: 15px;
  }

  .game-canvas-container {
    flex-direction: column;
    gap: 20px;
  }

  #snake-game {
    width: 100%;
    max-width: 350px;
    height: auto;
  }

  .game-controls {
    flex-direction: column;
    align-items: center;
  }

  .game-btn {
    width: 120px;
  }

  .game-score {
    flex-direction: column;
    gap: 10px;
  }
}

/* Color Wheel Tab Styles */
.color-wheel-layout {
  display: flex;
  height: 100%;
  gap: 20px;
}

.color-wheel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 500px;
}

.color-wheel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.color-wheel-demo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: conic-gradient(
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  position: relative;
  cursor: crosshair;
  border: 3px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-wheel-selector {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 2;
  left: 150px;
  top: 150px;
}

.wheel-center-info {
  text-align: center;
}

.selected-color-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.wheel-color-preview {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 3px solid var(--border);
  background-color: #6354A7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wheel-color-hex {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.wheel-color-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

.color-wheel-sidebar {
  width: 320px;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.wheel-section {
  margin-bottom: 30px;
}

.wheel-section:last-child {
  margin-bottom: 0;
}

.wheel-section-title {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.wheel-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.wheel-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wheel-control-group label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

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

.wheel-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-primary);
  outline: none;
  border: 1px solid var(--border);
}

.wheel-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wheel-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wheel-value {
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 0.9rem;
  min-width: 50px;
  text-align: right;
}

.color-formats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.format-group label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.format-input {
  display: flex;
  gap: 8px;
}

.format-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.9rem;
}

.copy-format-btn {
  padding: 8px 12px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-format-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}



/* Light theme overrides for Color Wheel */
body.light-theme .color-wheel-sidebar {
  background: #f8f9fa;
  border-color: #e0e0e0;
}

body.light-theme .wheel-section-title {
  color: #333333;
}

body.light-theme .wheel-control-group label {
  color: #333333;
}

body.light-theme .wheel-color-hex {
  color: #333333;
}

body.light-theme .wheel-color-name {
  color: #666666;
}

body.light-theme .format-group label {
  color: #333333;
}

body.light-theme .format-input input {
  background: #ffffff;
  color: #333333;
  border-color: #e0e0e0;
}



/* Responsive design for Color Wheel */
@media (max-width: 1024px) {
  .color-wheel-layout {
    flex-direction: column;
  }

  .color-wheel-sidebar {
    width: 100%;
    max-height: 400px;
  }

  .color-wheel-demo {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .color-wheel-main {
    padding: 15px;
  }

  .color-wheel-sidebar {
    padding: 15px;
  }

  .color-wheel-demo {
    width: 200px;
    height: 200px;
  }

  .wheel-color-preview {
    width: 60px;
    height: 60px;
  }

  .saved-colors-actions {
    flex-direction: column;
  }
}

/* High Score Celebration Animations */
.high-score-celebration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  animation: celebrationFadeIn 0.5s ease-out;
}

.celebration-content {
  text-align: center;
  color: #ffffff;
  position: relative;
  animation: celebrationBounce 0.8s ease-out;
}

.celebration-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: celebrationGlow 2s ease-in-out infinite alternate;
}

.celebration-score {
  font-size: 3rem;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: celebrationPulse 1s ease-in-out infinite;
}

.celebration-confetti {
  position: absolute;
  top: -50px;
  left: -50%;
  right: -50%;
  height: 200px;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear infinite;
}

/* Celebration Animations */
@keyframes celebrationFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes celebrationBounce {
  0% {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translateY(20px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes celebrationGlow {
  from {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.5);
  }
  to {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.8);
  }
}

@keyframes celebrationPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes highScoreFlash {
  0%, 100% {
    background-color: transparent;
    color: inherit;
  }
  50% {
    background-color: #FFD700;
    color: #000000;
    transform: scale(1.1);
  }
}

/* Mobile responsive celebration */
@media (max-width: 768px) {
  .celebration-title {
    font-size: 2rem;
  }

  .celebration-score {
    font-size: 2.5rem;
  }
}

/* Workspace */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.workspace-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-light);
}

.screen-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  transition: background-color 0.2s;
}

.screen-picker-btn:hover {
  background-color: var(--primary-color);
}

.workspace-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 16px;
  position: relative;
  transition: color 0.2s;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: transparent;
  transition: background-color 0.2s;
}

.tab-btn:hover {
  color: var(--text-light);
}

.tab-btn:hover::after {
  background-color: var(--border-color);
}

.tab-btn.active {
  color: var(--text-light);
}

.tab-btn.active::after {
  background-color: var(--primary-color);
}

.tab-actions {
  display: flex;
  margin-left: auto;
  gap: 8px;
}

.tab-action-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  transition: all 0.2s;
}

.tab-action-btn:hover {
  background-color: var(--panel-bg);
  color: var(--text-light);
}

.workspace-content {
  flex: 1;
  overflow: auto;
  background-color: var(--panel-bg);
  border-radius: 8px;
  padding: 16px;
}

/* Tab Content */
.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: block;
}

/* Color Wheel Demo */
.color-wheel-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.color-wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 100%;
  padding-bottom: 40px;
  box-sizing: border-box;
  min-height: min-content;
}

.color-wheel-demo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(
    red, yellow, lime, aqua, blue, magenta, red
  );
  position: relative;
  cursor: crosshair;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
  flex-shrink: 0;
}

.color-wheel-demo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    white 0%,
    transparent 70%
  );
}

.color-wheel-selector {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.color-wheel-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  background-color: var(--background-darker);
  padding: 20px;
  border-radius: 8px;
  margin-top: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.wheel-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wheel-control-group label {
  width: 80px;
  color: var(--text-light);
  font-size: 14px;
}

.wheel-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel-bg);
  border-radius: 3px;
  outline: none;
}

.wheel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
}

.wheel-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
}

.wheel-value {
  width: 50px;
  text-align: right;
  color: var(--text-light);
  font-size: 14px;
  font-family: monospace;
}

.selected-color-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.wheel-color-preview {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.wheel-color-hex {
  color: var(--text-light);
  font-size: 16px;
  font-family: monospace;
}

/* Responsive adjustments for Color Wheel */
@media (max-width: 768px) {
  .color-wheel-container {
    padding: 15px;
  }

  .color-wheel-wrapper {
    gap: 20px;
    max-width: 100%;
  }

  .color-wheel-demo {
    width: min(280px, calc(100vw - 60px));
    height: min(280px, calc(100vw - 60px));
    max-width: 280px;
    max-height: 280px;
  }

  .color-wheel-controls {
    padding: 15px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .color-wheel-container {
    padding: 10px;
  }

  .color-wheel-demo {
    width: min(240px, calc(100vw - 40px));
    height: min(240px, calc(100vw - 40px));
    max-width: 240px;
    max-height: 240px;
  }

  .wheel-control-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .wheel-control-group label {
    width: auto;
  }

  .wheel-slider {
    width: 100%;
  }
}

/* H Editor */
.hex-editor-container {
  display: flex;
  height: 100%;
  gap: 20px;
}

.image-editor {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

/* Scrollable wrapper for zoomed images */
.editor-image-wrapper {
  width: 100%;
  height: calc(100% - 50px);
  background-color: var(--panel-bg);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.editor-image-wrapper.scrollable {
  overflow: auto;
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.editor-image-wrapper.scrollable::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.editor-image-wrapper.scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.editor-image-wrapper.scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.editor-image-wrapper.scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
  background-clip: content-box;
}

.editor-image-wrapper.scrollable::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.2);
}

.editor-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  transition: all 0.3s ease;
}

.editor-image-wrapper.scrollable .editor-image-container {
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
}

.editor-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  cursor: crosshair;
  transition: transform 0.2s ease;
}

/* Grid Overlay Styles */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
  touch-action: none;
}

.grid-overlay.active {
  opacity: 1;
}

.grid-overlay svg {
  width: 100%;
  height: 100%;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1;
  fill: none;
}

.grid-overlay.dark .grid-line {
  stroke: rgba(255, 255, 255, 0.4);
}

.grid-overlay.light .grid-line {
  stroke: rgba(0, 0, 0, 0.4);
}









/* Resize dialog */
.resize-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--panel-bg);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 20px;
  width: 320px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--text-light);
  animation: resize-dialog-appear 0.3s ease-out;
}

@keyframes resize-dialog-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.resize-dialog h3 {
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 16px;
  text-align: center;
}

.resize-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.resize-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resize-input-group label {
  width: 60px;
  color: var(--text-light);
  font-size: 14px;
}

.resize-input-group input {
  flex: 1;
  background-color: var(--background-darker);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 14px;
  padding: 6px 8px;
}

.resize-input-group span {
  color: var(--text-dim);
  font-size: 14px;
}

.resize-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.resize-checkbox input {
  width: 16px;
  height: 16px;
}

.resize-checkbox label {
  color: var(--text-light);
  font-size: 14px;
}

.resize-note {
  margin-top: 12px;
  padding: 8px;
  background-color: rgba(99, 84, 167, 0.1);
  border-left: 3px solid var(--primary-color);
  border-radius: 4px;
}

.resize-note p {
  margin: 0;
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

.resize-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.resize-buttons button {
  flex: 1;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 10px 0;
  transition: all 0.2s;
  font-weight: 500;
}

.resize-buttons button:first-child {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.resize-buttons button:hover {
  background-color: var(--highlight);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resize-buttons button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Resize loading indicator */
.resize-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
}

.resize-loading p {
  color: white;
  margin-top: 12px;
  font-size: 14px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Disabled button styles */
.resize-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}



.eyedropper-status {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  max-width: 80%;
  line-height: 1.4;
}

.download-notification {
  background-color: var(--secondary-color);
  padding: 12px 20px;
}

.download-notification a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  margin-left: 5px;
}

.download-notification a:hover {
  text-decoration: none;
  color: #fff;
}

.image-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.zoom-controls, .extra-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fullscreen-icon {
  width: 18px;
  height: 18px;
  fill: var(--text-light);
}

#fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
}

#fullscreen-btn:hover .fullscreen-icon {
  fill: var(--primary-color);
}

/* Fullscreen mode styles */
.workspace.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

.workspace.fullscreen .workspace-header {
  margin-bottom: 5px;
  opacity: 0.7;
  transform: scale(0.9);
  transform-origin: left top;
}

.workspace.fullscreen .workspace-header h1 {
  color: white;
  font-size: 1.2rem;
}

.workspace.fullscreen .workspace-tabs {
  margin-bottom: 5px;
  opacity: 0.7;
  transform: scale(0.9);
  transform-origin: left top;
}

.workspace.fullscreen .workspace-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.workspace.fullscreen .hex-editor-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.workspace.fullscreen .image-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.workspace.fullscreen .editor-image-container {
  background-color: transparent;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 120px);
  overflow: auto;
  position: relative;
  /* Ensure scrollbars are always visible for large images */
  scrollbar-width: thin; /* For Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2); /* For Firefox */
}

/* Custom scrollbar styling for fullscreen mode */
.workspace.fullscreen .editor-image-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.workspace.fullscreen .editor-image-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.workspace.fullscreen .editor-image-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
}

.workspace.fullscreen .editor-image-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.workspace.fullscreen .editor-image {
  max-width: none; /* Allow image to be its natural size */
  max-height: none; /* Allow image to be its natural size */
  object-fit: contain;
}

/* For very large images, ensure they're at least as large as the viewport */
.workspace.fullscreen .editor-image.large-image {
  /* Allow large images to be scrolled */
  max-width: none;
  max-height: none;
  object-fit: initial;
}

.workspace.fullscreen .image-controls {
  display: none; /* Hide image controls in fullscreen mode */
}

.workspace.fullscreen .color-picker-tool {
  display: none;
}

/* Fullscreen Hex Input Panel */
.fullscreen-hex-input {
  position: fixed;
  top: 80px;
  right: 30px;
  background-color: rgba(30, 30, 30, 0.9);
  border-radius: 10px;
  padding: 25px;
  width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10001; /* Higher than exit button */
  max-height: 85vh;
  overflow-y: auto;
  cursor: move; /* Indicate the panel is draggable */
  user-select: none; /* Prevent text selection during drag */
}

.fs-color-preview {
  width: 220px;
  height: 150px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
  margin: 15px auto 20px auto;
  display: block;
  min-height: 150px !important;
}

.fs-color-preview:hover {
  transform: scale(1.05);
}

.fs-color-name {
  display: none; /* Hide the color name */
}

.fs-hex-value-display {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 14px;
  font-family: monospace;
  font-weight: 600;
  text-align: center;
  user-select: all;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.fs-hex-value-display:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.fs-hex-value-display.copied {
  background-color: rgba(76, 175, 80, 0.3);
}

/* Keep these for backward compatibility */
.fs-hex-input-container {
  display: none;
}

.fs-hex-label {
  display: none;
}

.fs-hex-input {
  display: none;
}

/* Add a title to the panel */
.fullscreen-hex-input::before {
  content: 'Color Values';
  display: block;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
  cursor: move; /* Ensure the header is also draggable */
}

/* Additional color format styles for fullscreen mode */
.fs-color-formats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fs-format-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fs-format-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

.fs-format-value {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 8px 10px;
  color: white;
  font-family: monospace;
  font-size: 14px;
  user-select: all;
  cursor: pointer;
  transition: background-color 0.2s;
}

.fs-format-value:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.fs-format-value.copied {
  background-color: rgba(76, 175, 80, 0.3);
}

.fs-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 5px 0;
}

/* Add a dragging state for the panel */
.fullscreen-hex-input.dragging {
  opacity: 0.9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  transition: none;
}

/* Make the hex input panel responsive */
@media (max-height: 800px) {
  .fullscreen-hex-input {
    top: 70px;
    padding: 20px;
    width: 340px;
  }

  .fs-color-preview {
    width: 200px;
    height: 120px;
    min-height: 120px !important;
  }

  .fs-format-value {
    padding: 6px 8px;
    font-size: 13px;
  }

  .fs-color-formats {
    gap: 10px;
  }
}

@media (max-height: 600px) {
  .fullscreen-hex-input {
    top: 60px;
    right: 20px;
    padding: 15px;
    width: 310px;
    max-height: 75vh;
  }

  .fs-color-preview {
    width: 180px;
    height: 100px;
    min-height: 100px !important;
  }

  .fs-hex-value-display {
    font-size: 13px;
    padding: 6px 8px;
  }

  .fullscreen-hex-input::before {
    font-size: 16px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .fs-format-label {
    font-size: 12px;
  }

  .fs-format-value {
    padding: 5px 8px;
    font-size: 12px;
  }

  .fs-color-formats {
    gap: 8px;
  }

  .fs-divider {
    margin: 3px 0;
  }
}

@media (max-height: 450px) {
  .fullscreen-hex-input {
    top: 50px;
    right: 15px;
    padding: 12px;
    width: 280px;
    max-height: 70vh;
  }

  .fs-color-preview {
    width: 150px;
    height: 80px;
    min-height: 80px !important;
    margin: 10px auto 15px auto;
  }

  .fs-color-name {
    font-size: 13px;
    margin-top: 5px;
  }

  .fs-hex-value-display {
    font-size: 12px;
    padding: 5px 6px;
    margin-bottom: 5px;
  }

  .fs-format-group {
    gap: 2px;
  }

  .fs-format-label {
    font-size: 11px;
  }

  .fs-format-value {
    padding: 3px 6px;
    font-size: 11px;
  }

  .fs-divider {
    margin: 2px 0;
  }

  .fs-color-formats {
    gap: 6px;
  }
}

/* For mobile devices in landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .fullscreen-hex-input {
    top: 40px;
    right: 15px;
    padding: 10px;
    width: 260px;
    max-height: 85vh;
  }

  .fs-color-preview {
    width: 120px;
    height: 70px;
    min-height: 70px !important;
    margin: 8px auto 12px auto;
  }

  .fs-hex-value-display {
    font-size: 11px;
    padding: 4px 6px;
    margin-bottom: 5px;
  }

  .fs-color-formats {
    gap: 5px;
  }

  .fs-format-value {
    padding: 3px 5px;
    font-size: 10px;
  }

  .fs-format-label {
    font-size: 10px;
  }

  .fs-divider {
    margin: 2px 0;
  }

  .fs-hex-input-container {
    margin-top: 0;
  }
}

/* Exit fullscreen button */
.exit-fullscreen-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(30, 30, 30, 0.9);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.exit-fullscreen-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2;
}

.exit-fullscreen-btn:hover {
  background-color: rgba(50, 50, 50, 0.95);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.eyedropper-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.eyedropper-icon .cls-1 {
  fill: currentColor;
  fill-rule: evenodd;
}







@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.context-menu-header {
  padding: 8px 16px;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.context-menu-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  color: var(--text-light);
  font-size: 14px;
  position: relative;
}

.context-menu-item span:first-of-type {
  flex: 1;
  margin-left: 8px;
}

.context-menu-item .shortcut {
  color: var(--text-dim);
  font-size: 12px;
  font-family: monospace;
  margin-left: 16px;
}

.context-menu-item:hover {
  background-color: var(--highlight);
  color: white;
}

.context-menu-item:hover .shortcut {
  color: rgba(255, 255, 255, 0.8);
}

.context-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.context-menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

.editor-btn {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.editor-btn.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  min-width: 80px;
  border: 2px solid var(--border-color);
}

.editor-btn.tool-btn svg {
  margin-bottom: 4px;
  width: 24px;
  height: 24px;
}

.editor-btn.tool-btn span {
  font-size: 12px;
  font-weight: 500;
}

.editor-btn.tool-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--highlight);
}

/* Enhance button states */
.editor-btn.tool-btn.enhance-active {
  background-color: var(--success);
  color: white;
  border-color: var(--success);
  position: relative;
}

.editor-btn.tool-btn.enhance-active::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Enhance loading overlay */
.enhance-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 4px;
}

.enhance-loading p {
  color: white;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* Flip button states */
.editor-btn.tool-btn.flip-horizontal {
  background-color: var(--highlight);
  color: white;
  border-color: var(--highlight);
  position: relative;
}

.editor-btn.tool-btn.flip-vertical {
  background-color: var(--secondary);
  color: white;
  border-color: var(--secondary);
  position: relative;
}

.editor-btn.tool-btn.flip-both {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
  position: relative;
}

/* Add indicators for flip direction */
.editor-btn.tool-btn.flip-horizontal::after {
  content: "↔";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-btn.tool-btn.flip-vertical::after {
  content: "↕";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-btn.tool-btn.flip-both::after {
  content: "⟲";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.editor-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.editor-btn.primary-btn {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

.editor-btn.primary-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}



.color-picker-tool {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--background-darker);
  border-radius: 8px;
  padding: 16px;
}

.picker-instructions {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 8px;
}

.small-note {
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
}

.picked-colors h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-light);
}

.color-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.picked-color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--panel-bg);
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.picked-color-item:hover {
  transform: translateX(4px);
}

.picked-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.picked-color-hex {
  font-family: monospace;
  font-size: 14px;
  color: var(--text-light);
}

.picked-color-item.highlight {
  background-color: var(--primary-color);
  transform: translateX(4px);
}

/* Gradient Tool */
.gradient-tool-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.gradient-preview-container {
  width: 100%;
  height: 200px;
  background-color: var(--panel-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gradient-preview {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #6354A7 0%, #F97F1F 100%);
}

.gradient-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--background-darker);
  padding: 20px;
  border-radius: 8px;
}

.gradient-type-selector,
.gradient-angle-control,
.gradient-position-control,
.gradient-stops-container,
.selected-stop-controls,
.gradient-code-output {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gradient-type-selector label,
.gradient-angle-control label,
.gradient-position-control label,
.gradient-stops-container label,
.stop-color-input label,
.stop-position-input label,
.gradient-code-output label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}

.gradient-type-buttons,
.position-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gradient-type-btn,
.position-btn {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  transition: all 0.2s;
}

.gradient-type-btn:hover,
.position-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.gradient-type-btn.active,
.position-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.angle-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel-bg);
  border-radius: 3px;
  outline: none;
}

.angle-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
}

.angle-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
}

.angle-value {
  font-size: 14px;
  color: var(--text-light);
  font-family: monospace;
}

.gradient-stops-track {
  position: relative;
  width: 100%;
  height: 30px;
  background: linear-gradient(to right, #ddd 0%, #ddd 100%);
  border-radius: 4px;
  margin: 10px 0;
  cursor: pointer;
}

.gradient-stop {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  top: 50%;
  cursor: grab;
  z-index: 10;
}

.gradient-stop.active {
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.2);
}

.stop-color-input,
.stop-position-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stop-color-input input,
.stop-position-input input {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 14px;
  padding: 8px;
  width: 100px;
}

.stop-color-preview {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.remove-stop-btn {
  background-color: #e74c3c;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  transition: background-color 0.2s;
  align-self: flex-start;
  margin-top: 10px;
}

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

.code-container {
  position: relative;
  background-color: var(--panel-bg);
  border-radius: 4px;
  padding: 12px;
  overflow: hidden;
}

#gradient-code {
  margin: 0;
  font-family: monospace;
  font-size: 14px;
  color: var(--text-light);
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-gradient-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: background-color 0.2s;
}

.copy-gradient-btn:hover {
  background-color: var(--accent-color);
}

/* Contrast Tool */
.contrast-tool-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

/* Preview Panels */
.contrast-preview-section {
  background-color: var(--panel-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contrast-preview-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-light);
}

.contrast-preview-panels {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Right panel contrast preview */
.right-panel-preview {
  flex-direction: column;
  gap: 8px;
}

.right-panel-preview .preview-panel {
  min-width: auto;
  margin-bottom: 5px;
}

.right-panel-preview .preview-content {
  min-height: 80px;
  padding: 12px 10px;
}

.right-panel-preview h2 {
  font-size: 16px;
  margin: 0;
  line-height: 1.3;
}

.right-panel-preview p {
  font-size: 13px;
  margin: 0;
  line-height: 1.3;
}

.right-panel-preview .preview-label {
  padding: 6px 10px;
  font-size: 12px;
}

.right-panel-preview .preview-status {
  padding: 6px 10px;
  font-size: 11px;
}

.right-panel-preview .status-detail {
  font-size: 10px;
}

.right-panel-preview .graphic-shapes {
  gap: 8px;
}

.right-panel-preview .shape {
  width: 20px;
  height: 20px;
}

.right-panel-preview .shape.triangle {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid white;
}

#contrast-preview-section {
  margin-bottom: 15px;
}

.preview-panel {
  flex: 1;
  min-width: 250px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.preview-label {
  background-color: var(--background-darker);
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-light);
}

.preview-content {
  flex: 1;
  min-height: 150px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.preview-status {
  padding: 8px 12px;
  font-size: 13px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-light);
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
}

.status-icon.pass {
  background-color: var(--success);
  color: white;
}

.status-icon.fail {
  background-color: var(--error);
  color: white;
}

.status-detail {
  color: var(--text-dim);
  font-size: 12px;
  margin-left: 5px;
}

/* Graphic shapes */
.graphic-shapes {
  display: flex;
  gap: 15px;
  align-items: center;
}

.shape {
  width: 30px;
  height: 30px;
  background-color: white;
}

.shape.square {
  border-radius: 2px;
}

.shape.circle {
  border-radius: 50%;
}

.shape.triangle {
  width: 0;
  height: 0;
  background-color: transparent;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 30px solid white;
}

.contrast-preview-container {
  width: 100%;
  height: 200px;
  background-color: var(--panel-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contrast-preview {
  width: 100%;
  height: 100%;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.contrast-text-sample {
  max-width: 600px;
  color: #6354A7;
}

.contrast-text-sample h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 24px;
}

.contrast-text-sample p {
  margin-bottom: 16px;
  line-height: 1.5;
}

.contrast-sample-btn {
  background-color: #6354A7;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

.contrast-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--background-darker);
  padding: 20px;
  border-radius: 8px;
}

.contrast-colors {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contrast-color-picker {
  flex: 1;
  min-width: 200px;
}

.contrast-color-picker label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.color-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-group input {
  flex: 1;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 14px;
  padding: 8px;
  font-family: monospace;
}

.color-preview {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.contrast-result {
  background-color: var(--panel-bg);
  border-radius: 8px;
  padding: 16px;
}

.contrast-ratio-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.contrast-ratio-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
}

.contrast-ratio-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.contrast-compliance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.compliance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--background-darker);
  border-radius: 4px;
}

.compliance-label {
  font-size: 14px;
  color: var(--text-light);
}

.compliance-status {
  font-size: 14px;
  font-weight: 600;
}

.compliance-status.pass {
  color: #4CAF50;
}

.compliance-status.fail {
  color: #F44336;
}

.contrast-suggestions h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 0;
  margin-bottom: 12px;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--panel-bg);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.suggestion-item:hover {
  transform: translateY(-2px);
}

.suggestion-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.suggestion-ratio {
  font-size: 14px;
  color: var(--text-light);
}

.swap-colors-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 16px;
  transition: background-color 0.2s;
  align-self: flex-start;
}

.swap-colors-btn:hover {
  background-color: var(--accent-color);
}

/* Right Panel */
.right-panel {
  width: 280px;
  background-color: var(--background-darker);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
}

.panel-section {
  margin-bottom: 24px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-light);
}

/* Hex Input Tool */
.hex-input-tool {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.color-preview-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.color-preview {
  width: 100%;
  height: 120px;
  transition: background-color 0.3s ease;
}

.color-name {
  width: 100%;
  padding: 6px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  background-color: rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.hex-input-container {
  display: flex;
  align-items: center;
  background-color: var(--panel-bg);
  border-radius: 4px;
  overflow: hidden;
}

.hex-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--border-color);
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  height: 36px;
  width: 36px;
}

.hex-input {
  flex: 1;
  background-color: var(--panel-bg);
  border: none;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  height: 36px;
  padding: 0 12px;
  width: 100%;
}

.hex-input:focus {
  outline: none;
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.default-formats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.additional-formats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.more-formats-toggle {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.more-formats-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.more-formats-btn:hover {
  color: var(--text-light);
  background-color: rgba(255, 255, 255, 0.1);
}

.more-formats-btn.active .more-icon {
  transform: rotate(180deg);
}

.more-icon {
  transition: transform 0.3s ease;
}

.value-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--panel-bg);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 4px;
}

.value-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.value-label {
  color: var(--text-dim);
  font-size: 12px;
}

.copy-value-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  transition: all 0.2s;
}

.copy-value-btn:hover {
  background-color: var(--border-color);
  color: var(--text-light);
}

.copy-value-btn.copied {
  color: var(--success);
}

.value-display {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.value-display span {
  color: var(--text-light);
  font-size: 14px;
}

/* Image Color Palette Strip */
.image-color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--panel-bg);
  border-radius: 6px;
  margin: 12px 0;
  border: 1px solid var(--border-color);
}

.palette-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.palette-control-btn {
  width: 24px;
  height: 24px;
  background-color: var(--background-darker);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.palette-control-btn:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.palette-strip {
  display: flex;
  flex: 1;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  min-width: 200px;
}

.palette-swatch {
  flex: 1;
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: none;
  min-width: 20px;
}

.palette-swatch:hover {
  transform: scaleY(1.1);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.palette-swatch.active {
  transform: scaleY(1.15);
  z-index: 3;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.palette-swatch:first-child {
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.palette-swatch:last-child {
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

.palette-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.palette-action-btn {
  width: 24px;
  height: 24px;
  background-color: var(--background-darker);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.palette-action-btn:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.download-dropdown,
.main-download-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--background-darker);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 180px;
  margin-top: 4px;
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-light);
  transition: background-color 0.2s ease;
  font-size: 14px;
}

.dropdown-item:hover {
  background: var(--primary-color);
}

.dropdown-item:first-child {
  border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 4px 4px;
}

/* Image to Hex Tool */
.image-to-hex-tool {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-preview-container {
  width: 100%;
  height: 120px;
  background-color: var(--panel-bg);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.upload-btn {
  width: 100%;
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
  transition: background-color 0.2s;
}

.upload-btn:hover {
  background-color: var(--accent-color);
}

/* Main Colors Section */
.main-colors-section {
  margin-top: 8px;
}

.main-colors-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
}

.main-colors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.main-color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background-color: var(--panel-bg);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.main-color-item:hover {
  background-color: var(--hover-bg);
  border-color: var(--border-color);
  transform: translateY(-1px);
}

.main-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.main-color-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.main-color-hex {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color);
  font-family: var(--mono-font);
}

.main-color-name {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.extracted-colors {
  display: none; /* Hide by default, show only when populated */
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px; /* Reduced margin */
  position: relative;
  width: 100%;
  /* Removed min-height to prevent empty space */
}

.dominant-color {
  display: none; /* Hide the dominant color since we're showing all colors in the palette */
}

.color-hex {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.color-palette {
  display: flex;
  width: 100%;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

/* Special styling for the right panel color palette */
.right-panel .extracted-colors .color-palette {
  margin-top: 10px;
  margin-bottom: 30px;
  height: 24px;
  border-radius: 4px;
  overflow: visible;
  display: flex !important; /* Force flex display */
  width: 100%; /* Ensure full width */
  min-height: 24px; /* Ensure minimum height */
  position: relative; /* For absolute positioning of children */
  z-index: 5; /* Ensure it's above other elements */
  visibility: visible !important; /* Force visibility */
  opacity: 1 !important; /* Force opacity */
}

.palette-color {
  flex: 1;
  height: 100%;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  display: block !important; /* Force display */
  min-width: 10px;
  visibility: visible !important; /* Force visibility */
  opacity: 1 !important; /* Force opacity */
}

.palette-color:hover {
  transform: scaleY(1.1);
}

/* Removed color-percentage styles - no longer needed */



/* Export Panel */
.export-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-format-selector {
  display: flex;
  gap: 4px;
}

.format-btn {
  flex: 1;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 0;
  transition: all 0.2s;
}

.format-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.export-preview {
  background-color: var(--background-darker);
  border-radius: 4px;
  padding: 12px;
  max-height: 150px;
  overflow-y: auto;
}

.export-code {
  margin: 0;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-light);
  white-space: pre-wrap;
}

.copy-btn {
  background-color: var(--primary-color);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background-color: var(--accent-color);
}

/* Harmony Panel */
.harmony-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.harmony-colors {
  display: flex;
  gap: 8px;
}

.harmony-color {
  flex: 1;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.harmony-color:hover {
  transform: scale(1.05);
}

/* Shades Panel */
.shades-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shades-gradient {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
}

.shades-list {
  display: flex;
  gap: 4px;
}

.shade-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
}

.shade-color {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  transition: transform 0.2s;
}

.shade-item:hover .shade-color {
  transform: translateY(-2px);
}

.shade-item.selected .shade-color {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shade-name {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}



.color-name-tag:hover {
  background-color: var(--border-color);
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.name-text {
  font-size: 12px;
  color: var(--text-light);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Screen Color Picker */
.screen-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  transition: background-color 0.2s;
}

.screen-picker-btn:hover {
  background-color: var(--primary-color);
}

.screen-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-darker);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.screen-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: var(--background-dark);
  border-bottom: 1px solid var(--border-color);
}

.screen-picker-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-btn:hover {
  background-color: var(--panel-bg);
  color: var(--text-light);
}

.screen-capture-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen-capture-container canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
}

.screen-picker-footer {
  padding: 12px 16px;
  background-color: var(--background-dark);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.color-magnifier, .image-magnifier {
  position: absolute;
  width: 160px;
  height: 200px;
  background-color: var(--background-dark);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.15s ease, transform 0.1s ease;
  backdrop-filter: blur(8px);
  background-color: rgba(var(--background-dark-rgb, 30, 30, 35), 0.95);
  transform: scale(1);
}

.color-magnifier:hover, .image-magnifier:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.magnifier-pixels {
  display: grid;
  gap: 1px;
  background-color: var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.magnifier-pixel {
  width: 8px;
  height: 8px;
  transition: transform 0.1s ease;
}

.magnifier-pixel.center-pixel {
  border: 2px solid var(--primary-color);
  box-sizing: border-box;
  transform: scale(1.1);
  box-shadow: 0 0 4px rgba(var(--primary-color-rgb, 99, 84, 167), 0.6);
}

.magnifier-color {
  height: 45px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

.magnifier-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-light);
}

.magnifier-color-preview {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.magnifier-coordinates {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: center;
  font-weight: 500;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.eyedropper-status {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--background-dark);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-size: 14px;
  pointer-events: none;
  border: 1px solid var(--primary-color);
}

/* Image Palette */
.image-palette {
  width: 100%;
  background-color: var(--background-dark);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.palette-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}

.palette-actions {
  display: flex;
  gap: 8px;
}

.palette-action-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.palette-action-btn:hover {
  background-color: var(--panel-bg);
  color: var(--text-light);
}

.palette-swatches {
  display: flex;
  align-items: center;
}

.palette-add-btn, .palette-remove-btn {
  width: 32px;
  height: 32px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.palette-add-btn:hover, .palette-remove-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.palette-swatch {
  flex: 1;
  height: 24px;
  cursor: pointer;
  transition: transform 0.1s;
  border: none;
}

.palette-swatch:hover {
  transform: scaleY(1.1);
}

.palette-swatch.active {
  box-shadow: inset 0 0 0 2px white;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .right-panel {
    width: 240px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 200px;
  }

  .right-panel {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .content-area {
    flex-direction: column;
  }

  .right-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
}

/* EyeDropper status message */
.eyedropper-status {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 10000;
  font-size: 14px;
  pointer-events: none;
}

/* Color Picker Instructions */
.color-picker-instructions-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.color-picker-instructions-container {
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.color-picker-instructions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.color-picker-instructions-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.color-picker-instructions-content {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
}

.color-picker-instructions-content h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-color);
}

.color-picker-instructions-content p {
  margin-bottom: 15px;
  line-height: 1.5;
}

.color-picker-instructions-content ol,
.color-picker-instructions-content ul {
  margin-bottom: 15px;
  padding-left: 25px;
}

.color-picker-instructions-content li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.color-picker-instructions-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.color-picker-instructions-content a:hover {
  text-decoration: underline;
}

.color-picker-instructions-content kbd {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  color: var(--text-color);
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 0.85em;
  line-height: 1;
  padding: 2px 5px;
  margin: 0 2px;
}

.manual-color-input {
  margin-top: 25px;
  padding: 15px;
  background-color: var(--input-bg);
  border-radius: 8px;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--mono-font);
}

#add-manual-color-btn {
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

/* Simple Color Picker */
.simple-color-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.simple-color-picker-container {
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  overflow: hidden;
}

.simple-color-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.simple-color-picker-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.simple-color-picker-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 5px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.1s;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.custom-swatch {
  border: 2px dashed var(--border-color);
}

.custom-color-input {
  display: flex;
  gap: 10px;
}

.custom-color-input .hex-input {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: var(--mono-font);
}

.add-custom-color-btn {
  padding: 8px 15px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.color-preview {
  width: 100%;
  height: 50px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.confirm-color-btn {
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

/* Color Wheel Overlay */
.color-wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.color-wheel-container {
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  overflow: hidden;
}

.color-wheel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.color-wheel-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-color);
  cursor: pointer;
}

.color-wheel-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.color-wheel {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.color-selector {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.brightness-slider {
  width: 100%;
  margin: 10px 0;
}

.color-preview {
  width: 100%;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.hex-input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--text-color);
  text-align: center;
  font-family: var(--mono-font);
}

.confirm-color-btn {
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 10px;
}

/* Color wheel picker */
.color-wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.color-wheel-container {
  background-color: #333;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.color-wheel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #222;
  color: white;
}

.color-wheel-header h3 {
  margin: 0;
  font-size: 16px;
}

.color-wheel-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.color-wheel-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.color-wheel {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  cursor: crosshair;
  position: relative;
}

.brightness-slider {
  width: 100%;
  margin: 10px 0;
}

.color-preview {
  width: 100%;
  height: 40px;
  border-radius: 4px;
  border: 1px solid #555;
}

.hex-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #555;
  background-color: #222;
  color: white;
  border-radius: 4px;
  text-align: center;
  font-family: monospace;
}

.confirm-color-btn {
  width: 100%;
  padding: 10px;
  background-color: #6354A7;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
}

.confirm-color-btn:hover {
  background-color: #7665B8;
}

/* Time Tracker Modal */
.time-tracker-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.time-tracker-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-tracker-content {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.time-tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.time-tracker-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.close-modal-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.time-tracker-body {
  padding: 24px;
}

.time-section {
  margin-bottom: 32px;
}

.time-section:last-child {
  margin-bottom: 0;
}

.time-section h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.time-description {
  margin: 12px 0 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

/* Advanced Flip Clock Styles - Inspired by Flip.js */
.flip-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.flip-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flip-card {
  position: relative;
  width: 64px;
  height: 84px;
  perspective: 300px;
  margin-bottom: 4px;
}

.flip-card-container {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* Top and bottom halves of the flip card */
.flip-card-top,
.flip-card-bottom {
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-color, #6354A7), var(--accent-color-dark, #4a3d8a)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.flip-card-top {
  top: 0;
  border-radius: 8px 8px 2px 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transform-origin: bottom;
}

.flip-card-bottom {
  bottom: 0;
  border-radius: 2px 2px 8px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform-origin: top;
}

/* Number display inside cards */
.flip-card-top .flip-number,
.flip-card-bottom .flip-number {
  position: absolute;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  font-family: 'Inter', monospace;
  letter-spacing: -1px;
}

.flip-card-top .flip-number {
  top: 0;
}

.flip-card-bottom .flip-number {
  bottom: 0;
}

/* Flip animation states */
.flip-card.flipping .flip-card-top {
  animation: flipTopDown 0.3s ease-in forwards;
  z-index: 3;
}

.flip-card.flipping .flip-card-bottom {
  animation: flipBottomUp 0.3s ease-out 0.3s forwards;
  z-index: 2;
  transform: rotateX(90deg);
}

/* Prepare the bottom card for animation */
.flip-card .flip-card-bottom {
  transform: rotateX(90deg);
  z-index: 1;
}

.flip-card:not(.flipping) .flip-card-bottom {
  transform: rotateX(0deg);
  z-index: 2;
}

@keyframes flipTopDown {
  0% {
    transform: rotateX(0deg);
    opacity: 1;
  }
  100% {
    transform: rotateX(-90deg);
    opacity: 0.8;
  }
}

@keyframes flipBottomUp {
  0% {
    transform: rotateX(90deg);
    opacity: 0.8;
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
  }
}

/* Shadow effects during flip */
.flip-card-top::after,
.flip-card-bottom::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flip-card.flipping .flip-card-top::after {
  opacity: 1;
}

.flip-card.flipping .flip-card-bottom::after {
  opacity: 0.5;
}

/* Separator styling */
.flip-separator {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 8px;
  animation: pulse 2s infinite ease-in-out;
  align-self: flex-start;
  margin-top: 20px;
}

@keyframes pulse {
  0%, 50% {
    opacity: 1;
    transform: scale(1);
  }
  25%, 75% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

/* Smooth entrance animation */
.flip-card {
  animation: flipCardEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.flip-card:nth-child(1) { animation-delay: 0.1s; }
.flip-card:nth-child(2) { animation-delay: 0.2s; }
.flip-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes flipCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Enhanced visual depth */
.flip-card-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 10px;
  z-index: -1;
}

/* Ensure consistent colors for all flip cards */
.flip-clock .flip-card .flip-card-top,
.flip-clock .flip-card .flip-card-bottom,
#session-time-clock .flip-card .flip-card-top,
#session-time-clock .flip-card .flip-card-bottom,
#current-time-clock .flip-card .flip-card-top,
#current-time-clock .flip-card .flip-card-bottom {
  background: linear-gradient(135deg, #6354A7, #4a3d8a) !important;
}

/* Force color consistency for seconds cards specifically */
.flip-card[data-unit="seconds"] .flip-card-top,
.flip-card[data-unit="seconds"] .flip-card-bottom {
  background: linear-gradient(135deg, #6354A7, #4a3d8a) !important;
  color: white !important;
}

.flip-card[data-unit="seconds"] .flip-number {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Additional specificity for all time units */
.time-tracker-modal .flip-card .flip-card-top,
.time-tracker-modal .flip-card .flip-card-bottom {
  background: linear-gradient(135deg, #6354A7, #4a3d8a) !important;
}

.time-tracker-modal .flip-number {
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Override any potential dark theme conflicts */
.flip-card-top,
.flip-card-bottom {
  background-color: #6354A7 !important;
  background-image: linear-gradient(135deg, #6354A7, #4a3d8a) !important;
}

/* Ensure no black backgrounds during animation */
.flip-card.flipping .flip-card-top,
.flip-card.flipping .flip-card-bottom {
  background: linear-gradient(135deg, #6354A7, #4a3d8a) !important;
  background-color: #6354A7 !important;
}

/* Prevent any transparency issues */
.flip-card-top .flip-number,
.flip-card-bottom .flip-number {
  background: transparent !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure smooth transitions */
.flip-card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-top,
.flip-card-bottom {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

/* Responsive adjustments for time tracker */
@media (max-width: 768px) {
  .time-tracker-content {
    width: 95%;
    margin: 20px;
  }

  .flip-card {
    width: 50px;
    height: 70px;
  }

  .flip-number {
    font-size: 24px;
  }

  .flip-separator {
    font-size: 28px;
  }
}
