:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.gradient-container {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#gradientCanvas {
    width: 100%;
    height: 600px;
    border-radius: 0.5rem;
    display: block;
}

.control-panel {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.control-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.control-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.control-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.control-input option {
    background: var(--bg-color);
}

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

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    transition: background 0.3s;
    margin-right: 0.75rem;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    font-weight: 500;
}

/* Slider */
.slider {
    width: calc(100% - 60px);
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin-right: 1rem;
}

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

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.control-group span {
    display: inline-block;
    min-width: 40px;
    text-align: right;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem 0;
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.btn:active {
    transform: translateY(0);
}

/* Color Info */
.color-info {
    margin-top: 2rem;
}

.color-info h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}

.color-swatch {
    height: 60px;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch::after {
    content: attr(data-color);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.color-swatch:hover::after {
    opacity: 1;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    #gradientCanvas {
        height: 400px;
    }
}

@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}
