/* Modern Minimalist Color Harmony Tool */

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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafbfc;
    --bg-tertiary: #f6f8fa;
    --border-light: #e1e4e8;
    --border-medium: #d1d5da;
    --text-primary: #24292e;
    --text-secondary: #586069;
    --text-tertiary: #6a737d;
    --accent-blue: #0366d6;
    --accent-green: #28a745;
    --accent-red: #d73a49;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f6f8fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Toolbar */
.toolbar {
    background: var(--bg-primary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 12px;
    color: var(--text-tertiary);
}

/* Buttons */
button {
    padding: 8px 14px;
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s ease;
    white-space: nowrap;
}

button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

button:active,
button.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.action-btn:hover {
    background: #22863a;
    border-color: #22863a;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 65px);
    padding: 24px;
    gap: 24px;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.header-with-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.canvas-area h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
}

.status-indicator.updating .status-dot {
    background: var(--accent-blue);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#canvas {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

/* Shape Controls */
.shape-controls {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.shape-controls h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.control-group {
    margin-bottom: 16px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.shape-controls select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.shape-controls select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

#size-slider {
    width: calc(100% - 45px);
    margin-right: 8px;
    vertical-align: middle;
}

#size-value {
    display: inline-block;
    min-width: 35px;
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 13px;
}

/* Color Wheel Area */
.color-wheel-area {
    width: 460px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.color-wheel-area h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

#color-wheel {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

/* Global Saturation Control */
.global-saturation-control {
    margin-bottom: 16px;
    padding: 12px;
    background: #e8f4ff;
    border: 1px solid #b3d9ff;
    border-radius: var(--radius-md);
}

/* Color Info Panel */
.color-info-panel {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.color-info-panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.color-code-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.color-code-item:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.color-preview {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

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

.color-value {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.color-value strong {
    color: var(--text-primary);
    font-weight: 600;
}

.copy-color-btn {
    padding: 6px 10px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.copy-color-btn:hover {
    background: #0256c7;
}

.empty-state {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    padding: 24px;
}

/* Custom Mode Editor */
.custom-mode-editor {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.custom-mode-editor h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.lock-controls {
    margin-bottom: 16px;
}

.rotation-lock-control,
.saturation-lock-control {
    margin-bottom: 8px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.saturation-lock-control:last-child {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.toggle-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-label input[type="checkbox"]:checked + .toggle-text {
    color: var(--accent-blue);
}

.custom-points-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.custom-point-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.custom-point-item label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 55px;
    font-weight: 500;
}

.custom-point-item input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
}

.custom-point-item input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.custom-point-item .remove-btn {
    padding: 4px 8px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.custom-point-item .remove-btn:hover {
    background: #cb2431;
}

.add-point-btn {
    width: 100%;
    padding: 8px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.add-point-btn:hover {
    background: #22863a;
}

/* Scrollbar Styling */
.color-wheel-area::-webkit-scrollbar {
    width: 8px;
}

.color-wheel-area::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

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

.color-wheel-area::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
