:root {
  /* Generated Color Palette - 2025-08-29 */
  /* Color Scheme: triadic - Paired Foreground/Background System */
  
  /* ============================================ */
  /* PAIRED COLOR SYSTEM */
  /* Colors 1-5: Backgrounds | Colors 6-10: Foregrounds */
  /* ============================================ */
  
  /* Background Colors (1-5) */
  --bg-primary: #f2d6b0;    /* Background 1 */
  --bg-secondary: #b0f2d6;  /* Background 2 */
  --bg-accent: #d6b0f2;     /* Background 3 */
  --bg-header: #f2e8d9;     /* Background 4 */
  --bg-card: #d9f2e8;       /* Background 5 */
  
  /* Paired Foreground Colors (6-10) with Contrast Info */
  --text-on-primary: #2a0f3d;   /* Foreground 6 - Contrast: 12.17:1 (AAA) */
  --text-on-secondary: #3d2a0f; /* Foreground 7 - Contrast: 10.75:1 (AAA) */
  --text-on-accent: #0f3d2a;    /* Foreground 8 - Contrast: 6.59:1 (AA) */
  --text-on-header: #8c33cc;    /* Foreground 9 - Contrast: 5.01:1 (AA) */
  --text-on-card: #3d2a0f;      /* Foreground 10 - Contrast: 11.6:1 (AAA) */
  
  /* ============================================ */
  /* LEGACY VARIABLES (Updated with new colors) */
  /* ============================================ */
  
  /* Primary colors from the triadic scheme */
  --primary-color: #d6b0f2;
  --secondary-color: #b0f2d6;
  --accent-color: #f2d6b0;
  
  /* Background using the warm tones */
  --background: linear-gradient(135deg, #f2d6b0 0%, #d6b0f2 100%);
  
  /* Surface colors using the light backgrounds */
  --surface: rgba(214, 176, 242, 0.3);
  --surface-hover: rgba(176, 242, 214, 0.4);
  
  /* Text colors using the high-contrast foregrounds */
  --text-primary: #2a0f3d;
  --text-secondary: #3d2a0f;
  
  /* Border using accent colors */
  --border: rgba(140, 51, 204, 0.3);
  
  /* Updated shadows and styling */
  --shadow: 0 8px 32px rgba(42, 15, 61, 0.2);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ============================================ */
  /* SEMANTIC COLOR VARIABLES */
  /* ============================================ */
  
  /* Primary Palette */
  --color-primary: #f2d6b0;
  --color-secondary: #b0f2d6;
  --color-accent: #d6b0f2;
  --color-neutral: #f2e8d9;
  --color-highlight: #d9f2e8;
  
  /* Additional Background Variants */
  --bg-footer: #f2d6b0;
  --bg-sidebar: #b0f2d6;
  --bg-section: #d6b0f2;
  --bg-hero: #f2e8d9;
  --bg-content: #d9f2e8;
  
  /* Typography Colors (Using Paired System) */
  --text-h1: #2a0f3d;     /* Uses paired foreground for bg-primary */
  --text-h2: #3d2a0f;     /* Uses paired foreground for bg-secondary */
  --text-h3: #0f3d2a;     /* Uses paired foreground for bg-accent */
  --text-h4: #8c33cc;     /* Uses paired foreground for bg-header */
  --text-h5: #3d2a0f;     /* Uses paired foreground for bg-card */
  --text-h6: #2a0f3d;
  --text-body: #2a0f3d;
  --text-lead: #3d2a0f;
  --text-small: #0f3d2a;
  --text-muted: rgba(42, 15, 61, 0.7);
  --text-emphasis: #8c33cc;
  --text-caption: rgba(61, 42, 15, 0.8);
  --text-on-footer: #2a0f3d;
  
  /* Button Colors (Using Paired System) */
  --btn-primary-bg: #f2d6b0;       /* Background 1 */
  --btn-primary-text: #2a0f3d;   /* Paired Foreground 6 */
  --btn-secondary-bg: #b0f2d6;   /* Background 2 */
  --btn-secondary-text: #3d2a0f; /* Paired Foreground 7 */
  --btn-accent-bg: #d6b0f2;         /* Background 3 */
  --btn-accent-text: #0f3d2a;     /* Paired Foreground 8 */
  --btn-success-bg: #f2e8d9;       /* Background 4 */
  --btn-success-text: #8c33cc;   /* Paired Foreground 9 */
  --btn-warning-bg: #d9f2e8;       /* Background 5 */
  --btn-warning-text: #3d2a0f;   /* Paired Foreground 10 */
  --btn-info-bg: #b0f2d6;
  --btn-info-text: #3d2a0f;
  --btn-outline-bg: transparent;
  --btn-outline-text: #2a0f3d;
  --btn-outline-border: #2a0f3d;
  
  /* Link Colors */
  --link-primary: #8c33cc;
  --link-secondary: #8c33cc;
  --link-hover: #0f3d2a;
  --link-visited: #2a0f3d;
  
  /* Borders & Dividers */
  --border-primary: rgba(176, 242, 214, 0.3);
  --border-secondary: rgba(214, 176, 242, 0.2);
  --border-accent: rgba(242, 232, 217, 0.25);
  --border-light: rgba(140, 51, 204, 0.15);
  --border-dark: rgba(61, 42, 15, 0.4);
  --divider: rgba(0, 0, 0, 0.1);
  --divider-strong: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title-gradient {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite;
}

.title-text {
    color: var(--text-primary);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: fadeIn 1s ease-out 0.3s both;
}

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

.control-panel, .palette-display {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideInLeft 0.6s ease-out;
}

.palette-display {
    animation: slideInRight 0.6s ease-out;
}

.control-panel:hover, .palette-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.color-picker-section {
    margin-bottom: 2rem;
}

.color-input-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 1rem 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.color-input-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.color-input {
    width: 120%;
    height: 120%;
    border: none;
    cursor: pointer;
    position: absolute;
    top: -10%;
    left: -10%;
}

.color-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    transition: var(--transition);
}

.color-input-wrapper:hover .color-input-overlay {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.hex-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    transition: var(--transition);
}

.hex-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.scheme-selector {
    margin-bottom: 2rem;
}

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

.scheme-btn {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.scheme-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.scheme-btn:hover::before {
    left: 100%;
}

.scheme-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.scheme-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group label {
    min-width: 80px;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    transition: var(--transition);
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.control-value {
    min-width: 40px;
    font-weight: 600;
    color: var(--primary-color);
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.generate-btn, .use-scheme-btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}

.generate-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.use-scheme-btn {
    background: linear-gradient(45deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.generate-btn:hover, .use-scheme-btn:hover {
    transform: translateY(-2px);
}

.generate-btn:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.use-scheme-btn:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.generate-btn:active, .use-scheme-btn:active {
    transform: translateY(0);
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.color-swatch:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.color-swatch::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: var(--transition);
}

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

.color-codes {
    display: grid;
    gap: 0.5rem;
}

.color-code {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    transition: var(--transition);
    cursor: pointer;
}

.color-code:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.export-section {
    animation: fadeInUp 0.8s ease-out 0.3s both;
    margin-bottom: 3rem;
}

.export-container {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.export-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.export-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.export-btn {
    position: relative;
    padding: 1rem 1.5rem;
    background: linear-gradient(45deg, #10b981, #059669);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    flex: 1;
}

.export-btn.secondary {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.export-btn.secondary:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

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

.export-preview {
    position: relative;
}

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

.css-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e5e7eb;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

.css-code .css-property {
    color: #8dd3c7;
}

.css-code .css-value {
    color: #ffffb3;
}

.css-code .css-comment {
    color: #bebada;
    font-style: italic;
}

.demo-section {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.demo-container {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    height: 500px;
}

.demo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: white;
}

.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent);
    filter: blur(1px);
    animation: float 20s infinite linear;
}

.orb-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-duration: 30s;
    animation-direction: reverse;
}

.orb-3 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 70%;
    animation-duration: 35s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================ */
/* COLOR PAIR UTILITY CLASSES */
/* ============================================ */

/* Background/Foreground Pairs */
.bg-primary { background: var(--bg-primary); color: var(--text-on-primary); }
.bg-secondary { background: var(--bg-secondary); color: var(--text-on-secondary); }
.bg-accent { background: var(--bg-accent); color: var(--text-on-accent); }
.bg-header { background: var(--bg-header); color: var(--text-on-header); }
.bg-card { background: var(--bg-card); color: var(--text-on-card); }

/* Typography */
h1 { color: var(--text-h1); }
h2 { color: var(--text-h2); }
h3 { color: var(--text-h3); }
h4 { color: var(--text-h4); }
h5 { color: var(--text-h5); }
h6 { color: var(--text-h6); }
p { color: var(--text-body); }
.lead { color: var(--text-lead); }
small, .small { color: var(--text-small); }
.muted { color: var(--text-muted); }

/* Buttons */
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
.btn-accent { background: var(--btn-accent-bg); color: var(--btn-accent-text); }
.btn-success { background: var(--btn-success-bg); color: var(--btn-success-text); }
.btn-warning { background: var(--btn-warning-bg); color: var(--btn-warning-text); }

/* Links */
a { color: var(--link-primary); }
a:hover { color: var(--link-hover); }
a:visited { color: var(--link-visited); }

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0;
    }
    
    .container {
        padding: 1rem;
    }
    
    .scheme-buttons {
        grid-template-columns: 1fr;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .control-group label {
        min-width: auto;
    }
}