/* Lesson 4 CSS - Colors & Units Examples */

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    margin: 0;
    background: #f8fafc;
    color: #1e293b;
}

/* Example container */
.example-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* Header styling */
.example-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.example-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.lesson-subtitle {
    margin: 0 0 2rem 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
.example-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Content area */
.example-content {
    padding: 2rem;
}

/* Demo sections */
.demo-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.demo-section h3 {
    color: #8b5cf6;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

/* Color Explorer */
.color-explorer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.color-input-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.color-format-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.format-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.format-tab.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
    background: #f3f4f6;
}

.color-inputs {
    margin-bottom: 1.5rem;
}

.input-group {
    display: none;
}

.input-group.active {
    display: block;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 1rem;
}

.input-group input[type="text"] {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
    width: 120px;
}

.rgb-controls,
.hsl-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.rgb-control,
.hsl-control {
    text-align: center;
}

.rgb-control label,
.hsl-control label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.rgb-control input[type="range"],
.hsl-control input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.rgb-control span,
.hsl-control span {
    display: block;
    font-weight: 500;
    color: #8b5cf6;
    font-size: 0.9rem;
}

.color-output {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
}

.output-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.output-item {
    font-family: monospace;
    font-size: 0.9rem;
}

.color-preview {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.color-swatch {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    background: #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.color-variations {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.variation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.variation-item {
    text-align: center;
}

.variation-swatch {
    width: 100%;
    height: 60px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 2px solid #e2e8f0;
}

/* Footer */
.example-footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 2rem;
    text-align: center;
}

/* Code elements */
code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 768px) {
    .example-header {
        padding: 1.5rem 1rem;
    }
    
    .example-content {
        padding: 1rem;
    }
    
    .color-explorer {
        grid-template-columns: 1fr;
    }
    
    .rgb-controls,
    .hsl-controls {
        grid-template-columns: 1fr;
    }
}
