/* Modern, stylish CSS for LAB Color Converter */

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #10b981;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    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.25rem;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

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

.lab-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-bg);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.convert-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.convert-button:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    animation: fadeIn 0.8s ease-out;
}

.primary-color {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.primary-color h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.color-display {
    width: 100%;
    height: 200px;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.color-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-info p {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

/* Lighting Conditions */
.lighting-conditions {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.lighting-conditions h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.lighting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.lighting-swatch {
    text-align: center;
    transition: var(--transition);
}

.lighting-swatch:hover {
    transform: translateY(-4px);
}

.swatch {
    width: 100%;
    height: 80px;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.lighting-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.temp-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Color Description */
.color-description {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.color-description h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.color-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.color-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.color-components h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.color-component {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border-color);
}

.component-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .lab-inputs {
        grid-template-columns: 1fr;
    }
    
    .lighting-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1rem;
    }
    
    .color-display {
        height: 150px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1e293b;
        --card-bg: #0f172a;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
    
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    }
    
    .input-group input {
        background: #1e293b;
    }
    
    .color-info p {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }
    
    .color-component {
        background: #1e293b;
        border-color: #334155;
    }
}