/**
 * Color Picker - GreenGetWare Theme
 */

:root {
  --primary: #39d353;
  --primary-dark: #176f3c;
  --primary-gradient: linear-gradient(135deg, #39d353 0%, #176f3c 100%);
  --primary-light: rgba(57, 211, 83, 0.15);
  --accent: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  
  --bg-primary: #0a0a12;
  --bg-secondary: #10101c;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(18, 18, 30, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.06);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(0, 0, 0, 0.02);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 30% 0%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-lg); }
.text-gradient { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Header */
.app-header {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section { display: flex; flex-direction: column; gap: 2px; }
.logo { display: flex; align-items: center; gap: var(--space-sm); font-size: 1.5rem; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.logo i { color: var(--accent); font-size: 1.75rem; }
.brand-badge { font-size: 0.6875rem; color: var(--text-muted); }

.header-actions { display: flex; gap: var(--space-sm); }
.btn-icon {
  width: 40px; height: 40px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.btn-icon:hover { background: var(--primary-gradient); border-color: var(--primary); color: white; }

.btn-home {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-gradient);
  border: none; border-radius: var(--radius-md);
  color: white; font-weight: 600; text-decoration: none;
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.3);
  transition: all 0.2s ease;
}
.btn-home:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(57, 211, 83, 0.4); color: white; }
.btn-home span { display: none; }
@media (min-width: 768px) { .btn-home span { display: inline; } }

/* Main Content */
.main-content { padding: var(--space-xl) 0; }

/* Hero */
.hero-section { text-align: center; margin-bottom: var(--space-xl); padding: var(--space-lg) 0; }
.hero-icon {
  width: 90px; height: 90px;
  background: var(--accent-gradient);
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-lg);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.4), 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-icon i { font-size: 2.5rem; color: white; }
.hero-section h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: var(--space-sm); }
.hero-section p { color: var(--text-secondary); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 992px) { .app-grid { grid-template-columns: 1fr; } }

/* Cards */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}
.app-card:hover { border-color: rgba(139, 92, 246, 0.3); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); }

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-sm);
}
.card-header h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: var(--space-sm); }
.card-header h3 i { color: var(--accent); }
.card-body { padding: var(--space-lg); }

/* Color Preview */
.color-preview-large {
  height: 120px;
  border-radius: var(--radius-md);
  background: #39d353;
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
  overflow: hidden;
}
.color-info {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
}
.color-hex { font-family: monospace; font-size: 1.25rem; font-weight: 700; color: white; }

/* Inputs */
.color-inputs { margin-bottom: var(--space-md); }
.picker-row {
  display: flex; gap: var(--space-sm); align-items: center;
}
.picker-row input[type="color"] {
  width: 50px; height: 40px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; padding: 0;
}
.picker-row input[type="text"] {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 1rem;
}

/* Sliders */
.color-sliders { margin-bottom: var(--space-md); }
.slider-group {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.slider-group label {
  width: 24px; font-weight: 600; color: var(--text-muted); font-size: 0.875rem;
}
.slider-group input[type="range"] {
  flex: 1; height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  -webkit-appearance: none;
}
.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--primary-gradient);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(57, 211, 83, 0.4);
}
.slider-group span {
  min-width: 45px; text-align: right;
  font-size: 0.875rem; color: var(--primary); font-weight: 600;
}

/* Format Outputs */
.format-outputs { display: flex; flex-direction: column; gap: var(--space-sm); }
.format-row {
  display: flex; align-items: center; gap: var(--space-sm);
}
.format-label {
  width: 50px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
}
.format-row input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.8125rem;
}

/* Copy Button */
.copy-btn {
  width: 36px; height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.copy-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }
.copy-btn.copied { background: var(--primary); border-color: var(--primary); color: white; }

/* Palette */
.palette-actions { display: flex; gap: var(--space-sm); align-items: center; }
.palette-actions select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-primary);
  font-size: 0.8125rem;
}
.action-btn {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--accent-gradient);
  border: none; border-radius: var(--radius-sm);
  color: white; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4); }

.palette-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm); margin-bottom: var(--space-md);
}
.palette-color {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--space-xs);
}
.palette-color:hover { transform: scale(1.05); }
.palette-color span {
  font-size: 0.625rem; font-family: monospace;
  background: rgba(0,0,0,0.5); padding: 2px 4px;
  border-radius: 4px; color: white;
}

.palette-export { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.export-btn {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer; transition: all 0.2s ease;
}
.export-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.upload-area:hover { border-color: var(--accent); background: rgba(139, 92, 246, 0.05); }
.upload-area i { font-size: 2.5rem; color: var(--accent); margin-bottom: var(--space-sm); display: block; }
.upload-area p { color: var(--text-secondary); }

.image-preview { margin-top: var(--space-md); }
.image-preview canvas { width: 100%; border-radius: var(--radius-sm); margin-bottom: var(--space-md); }
.extracted-colors { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.extracted-color {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid transparent;
}
.extracted-color:hover { transform: scale(1.1); border-color: white; }

/* Saved Colors */
.saved-colors { min-height: 100px; }
.saved-colors .empty-state {
  text-align: center; padding: var(--space-lg);
  color: var(--text-muted);
}
.saved-colors .empty-state i { font-size: 2rem; margin-bottom: var(--space-sm); display: block; }
.saved-list { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.saved-color {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}
.saved-color:hover { transform: scale(1.1); }
.saved-color .delete-btn {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: #ef4444; border: none; border-radius: 50%;
  color: white; font-size: 0.625rem;
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.saved-color:hover .delete-btn { display: flex; }

/* Gradient */
.gradient-preview {
  height: 100px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #39d353 0%, #176f3c 100%);
}
.gradient-controls {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md); margin-bottom: var(--space-md);
}
.gradient-color, .gradient-angle, .gradient-type {
  display: flex; flex-direction: column; gap: var(--space-xs);
}
.gradient-controls label { font-size: 0.75rem; color: var(--text-muted); }
.gradient-controls input[type="color"] { width: 100%; height: 36px; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.gradient-controls input[type="range"] { width: 100%; }
.gradient-controls select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  color: var(--text-primary);
}
.gradient-output {
  display: flex; gap: var(--space-sm);
}
.gradient-output input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.75rem;
}

/* Contrast Checker */
.contrast-preview {
  height: 80px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.25rem; font-weight: 600;
}
.contrast-inputs {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md); margin-bottom: var(--space-md);
}
.contrast-color { display: flex; flex-direction: column; gap: var(--space-xs); }
.contrast-color label { font-size: 0.75rem; color: var(--text-muted); }
.contrast-color input { width: 100%; height: 40px; border: none; border-radius: var(--radius-sm); cursor: pointer; }

.contrast-result { display: flex; gap: var(--space-lg); align-items: center; }
.ratio-display { text-align: center; }
.ratio-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: block; }
.ratio-label { font-size: 0.75rem; color: var(--text-muted); }
.wcag-results { display: flex; gap: var(--space-sm); }
.wcag-item {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-align: center;
}
.wcag-level { font-size: 0.75rem; color: var(--text-muted); display: block; }
.wcag-status { font-size: 0.875rem; font-weight: 600; }
.wcag-item.pass .wcag-status { color: var(--primary); }
.wcag-item.fail .wcag-status { color: #ef4444; }

/* Features */
.features-section { margin-top: var(--space-2xl); padding-top: var(--space-2xl); border-top: 1px solid var(--border-color); }
.features-section h2 { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: var(--space-xl); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-lg); }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.3s ease;
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 0 40px rgba(139, 92, 246, 0.15); }
.feature-icon {
  width: 60px; height: 60px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md);
}
.feature-icon i { font-size: 1.75rem; color: var(--accent); }
.feature-card h3 { font-size: 1.125rem; margin-bottom: var(--space-sm); }
.feature-card p { font-size: 0.875rem; color: var(--text-secondary); }

/* Footer */
.app-footer { padding: var(--space-xl) 0; text-align: center; border-top: 1px solid var(--border-color); margin-top: var(--space-2xl); }
.app-footer p { color: var(--text-muted); font-size: 0.875rem; }

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.75rem; }
  .palette-grid { grid-template-columns: repeat(5, 1fr); }
  .gradient-controls { grid-template-columns: 1fr; }
  .contrast-inputs { grid-template-columns: 1fr; }
}
