/* FINAL CORRECTED VERSION - imagecolorpicker.css */
:root { --background-color: #f8f9fa; --card-background: #ffffff; --border-color: #e9ecef; --text-color: #212529; --text-light: #6c757d; --primary-color: #007bff; --primary-hover: #0056b3; --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); --card-radius: 12px; }
body { background-color: var(--background-color); color: var(--text-color); font-family: var(--font-family); }
.main-content { padding: 2rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.simple-header { text-align: center; margin-bottom: 1.5rem; }
.simple-header h1 { font-size: 1.75rem; margin-bottom: 0.5rem; margin-top: 0; }
.simple-header p { font-size: 1rem; color: var(--text-light); margin: 0; }
.card { background-color: var(--card-background); border: 1px solid var(--border-color); border-radius: var(--card-radius); box-shadow: var(--card-shadow); overflow: hidden; height: 100%; }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); }
.card-title { font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.card-description { font-size: 0.9rem; color: var(--text-light); margin: 0.25rem 0 0; }
.card-content { padding: 1.5rem; }
.main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.image-section, .controls-section { min-width: 0; }
.upload-area { cursor: pointer; }
.upload-area.dragover .image-preview { outline: 2px dashed var(--primary-color); outline-offset: 4px; }
.image-preview { position: relative; width: 100%; aspect-ratio: 4 / 3; background-color: #f1f1f1; border-radius: 8px; overflow: hidden; display: flex; justify-content: center; align-items: center; transition: outline 0.2s; }
.preview-img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-img.picker-active { cursor: none; }
#loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 4px solid white; box-shadow: 0 5px 15px rgba(0,0,0,0.25); pointer-events: none; background-repeat: no-repeat; image-rendering: pixelated; z-index: 10; }
#loupe::before, #loupe::after { content: ''; position: absolute; top: 50%; left: 50%; background-color: white; box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); border-radius: 0; border: none; }
#loupe::before { width: 2px; height: 20px; transform: translate(-50%, -50%); }
#loupe::after { width: 20px; height: 2px; transform: translate(-50%, -50%); }
.image-controls { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.control-btn { background-color: #f1f3f5; border: 1px solid var(--border-color); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: background-color 0.2s, color 0.2s; }
.control-btn:hover, .control-btn.active { background-color: var(--primary-color); color: white; }
.control-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.controls-card .card-content { display: flex; flex-direction: column; gap: 1.5rem; }

/* Compact Controls Layout */
.controls-compact { margin-bottom: 1.5rem; }
.control-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 1rem; align-items: end; }
.control-group-compact { display: flex; flex-direction: column; gap: 0.5rem; }
.control-label-compact { font-size: 0.875rem; font-weight: 500; display: flex; justify-content: space-between; }
.control-value { font-weight: normal; color: var(--text-light); }

/* Compact form elements */
.select-compact, .slider-compact { padding: 0.5rem; border: 1px solid #ccc; border-radius: 6px; background-color: white; font-size: 0.875rem; }
.select-compact:disabled, .slider-compact:disabled { background-color: #e9ecef; }
.slider-compact { -webkit-appearance: none; appearance: none; height: 6px; background: #ddd; outline: none; border-radius: 3px; }
.slider-compact::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: var(--primary-color); cursor: pointer; border-radius: 50%; }
.slider-compact:disabled::-webkit-slider-thumb { background: #adb5bd; }

/* Compact button */
.copy-all-btn-compact { background: none; border: 1px solid var(--border-color); color: var(--text-color); padding: 0.5rem 0.75rem; font-size: 0.875rem; font-weight: 500; border-radius: 6px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 0.5rem; transition: background-color 0.2s; white-space: nowrap; }
.copy-all-btn-compact:hover { background-color: #f1f3f5; }
.copy-all-btn-compact:disabled { background-color: #e9ecef; border-color: #e9ecef; color: #6c757d; cursor: not-allowed; }

/* Palette Section */
.palette-section { flex: 1; }

/* Legacy styles for backward compatibility */
.control-group { display: flex; flex-direction: column; gap: 0.75rem; }
.control-label { font-weight: 500; display: flex; justify-content: space-between; }
.select-input, .slider { width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 6px; background-color: white; }
.select-input:disabled, .slider:disabled { background-color: #e9ecef; }
.slider { -webkit-appearance: none; appearance: none; height: 8px; background: #ddd; outline: none; border-radius: 4px; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; background: var(--primary-color); cursor: pointer; border-radius: 50%; }
.slider:disabled::-webkit-slider-thumb { background: #adb5bd; }
.action-group { margin-top: auto; }
.action-btn { width: 100%; padding: 0.75rem; font-size: 1rem; font-weight: 500; border-radius: 6px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 0.5rem; transition: background-color 0.2s; }
.action-btn.secondary { background: none; border: 1px solid var(--border-color); color: var(--text-color); }
.action-btn.secondary:hover { background-color: #f1f3f5; }
.action-btn:disabled { background-color: #e9ecef; border-color: #e9ecef; color: #6c757d; cursor: not-allowed; }
.color-palette { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.color-item { cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); }
.color-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.color-swatch { width: 80px; height: 60px; position: relative; display: flex; align-items: center; justify-content: center; }
.color-code { font-size: 0.75rem; font-family: monospace; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 3px; }
.color-info { padding: 0.75rem; background-color: var(--card-background); text-align: center; font-family: monospace; }
.copy-feedback { display: inline-block; color: var(--primary-color); font-weight: bold; animation: smooth-fade 1.5s ease-in-out; }
@keyframes smooth-fade { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.loading-state { text-align: center; padding: 2rem; color: var(--text-light); }
.loading-spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top-color: var(--primary-color); border-radius: 50%; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden { display: none; }
@media (max-width: 900px) { 
  .main-grid { grid-template-columns: 1fr; }
  .control-row { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .control-group-compact:nth-child(3), .control-group-compact:nth-child(4) { grid-column: 1 / -1; }
  .color-swatch { width: 70px; height: 55px; }
  .color-code { font-size: 0.7rem; }
}

/* SEO Content Section */
.seo-content { margin-top: 4rem; padding: 3rem 0; background-color: #fafbfc; }
.content-grid { display: grid; gap: 2.5rem; max-width: 1000px; margin: 0 auto; padding: 0 1rem; }
.content-section { background: white; padding: 2rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.content-section h2 { color: #2d3748; font-size: 1.5rem; margin: 0 0 1rem 0; font-weight: 600; }
.content-section h3 { color: #4a5568; font-size: 1.25rem; margin: 1.5rem 0 1rem 0; font-weight: 600; }
.content-section h4 { color: #4a5568; font-size: 1.1rem; margin: 1rem 0 0.5rem 0; font-weight: 600; }
.content-section p { color: #2d3748; line-height: 1.6; margin-bottom: 1rem; }
.content-section ul { margin: 1rem 0; padding-left: 1.5rem; }
.content-section li { color: #4a5568; line-height: 1.6; margin-bottom: 0.5rem; }

.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.format-item { padding: 1.5rem; background: #f7fafc; border-radius: 8px; border-left: 4px solid var(--primary-color); }
.format-item h4 { margin: 0 0 0.5rem 0; color: var(--primary-color); }
.format-item p { margin: 0; font-size: 0.9rem; color: #4a5568; }

.use-cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.use-case { padding: 1.5rem; background: #f0f9ff; border-radius: 8px; }
.use-case h4 { margin: 0 0 0.75rem 0; color: #1e40af; font-size: 1rem; }
.use-case p { margin: 0; font-size: 0.9rem; color: #374151; line-height: 1.5; }

@media (max-width: 768px) {
  .seo-content { margin-top: 2rem; padding: 2rem 0; }
  .content-section { padding: 1.5rem; }
  .format-grid, .use-cases-grid { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 600px) {
  .control-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .color-swatch { width: 60px; height: 50px; }
  .color-code { font-size: 0.65rem; padding: 1px 4px; }
  .content-section { padding: 1rem; }
  .content-section h2 { font-size: 1.25rem; }
}