/* ========================================
   WPLACE COLOR CONVERTER - MAGIC UI DESIGN SYSTEM
   World-Class UI with Emerald & Amber Theme
   ======================================== */

/* ==================== DESIGN TOKENS ==================== */
:root {
    /* Core Colors - Emerald & Amber */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;
    --emerald-950: #022c22;
    
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --amber-800: #92400e;
    --amber-900: #78350f;
    --amber-950: #451a03;
    
    /* Neutral Colors */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    
    /* Semantic Colors */
    --color-primary: var(--emerald-500);
    --color-primary-hover: var(--emerald-600);
    --color-secondary: var(--amber-500);
    --color-secondary-hover: var(--amber-600);
    --color-success: var(--emerald-500);
    --color-warning: var(--amber-500);
    --color-error: #ef4444;
    
    /* Background Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    
    /* Text Colors - Light Theme */
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-700);
    --text-muted: var(--slate-500);
    
    /* Border Colors - Light Theme */
    --border-default: rgba(226, 232, 240, 0.8);
    --border-hover: rgba(203, 213, 225, 1);
    --border-focus: var(--emerald-500);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--emerald-400) 0%, var(--emerald-600) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--amber-400) 0%, var(--amber-600) 100%);
    --gradient-mixed: linear-gradient(135deg, var(--emerald-500) 0%, var(--amber-500) 100%);
    --gradient-dark: linear-gradient(180deg, var(--slate-900) 0%, var(--slate-950) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    
    /* Shadows - Light Theme */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.2);
    --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.2);
    --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.2);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Animation */
    --duration-fast: 150ms;
    --duration-base: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;
    --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================== GLOBAL RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafb 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Magic UI Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--emerald-400) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, var(--amber-400) 0%, transparent 40%);
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Animated Gradient Orbs */
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    top: -300px;
    right: -300px;
    background: radial-gradient(circle, var(--emerald-300) 0%, transparent 70%);
    opacity: 0.05;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
    z-index: 0;
}

/* ==================== MAGIC UI COMPONENTS ==================== */

/* Glass Morphism Card */
.magic-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.magic-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-base);
}

.magic-card:hover::before {
    opacity: 1;
}

/* Gradient Border Card */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: var(--gradient-mixed);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: exclude;
    mask-composite: exclude;
}

/* Glow Button */
.magic-button {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-base);
    overflow: hidden;
}

.magic-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform var(--duration-slow);
}

.magic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.magic-button:hover::before {
    transform: translateX(100%);
}

/* Floating Label Input */
.magic-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.magic-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--duration-base);
}

.magic-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.magic-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all var(--duration-base);
    pointer-events: none;
}

.magic-input:focus + .magic-label,
.magic-input:not(:placeholder-shown) + .magic-label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    background: var(--bg-primary);
    padding: 0 0.25rem;
    color: var(--color-primary);
}

/* Animated Progress Bar */
.magic-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.magic-progress-bar {
    height: 100%;
    background: var(--gradient-mixed);
    border-radius: var(--radius-full);
    animation: shimmer 2s infinite linear;
    background-size: 200% 100%;
}

/* Tooltip */
.magic-tooltip {
    position: relative;
    display: inline-block;
}

.magic-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--slate-800);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-base);
    box-shadow: var(--shadow-lg);
}

.magic-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Badge */
.magic-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 10;
    user-select: none;
    cursor: pointer;
    transition: all var(--duration-base);
}

/* ==================== ANIMATIONS ==================== */
@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 shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.8);
    }
}

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

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== NAVIGATION BAR ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    z-index: 1000;
    transition: all var(--duration-base);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.nav-brand:hover {
    text-decoration: none;
    color: inherit;
}

.nav-logo {
    width: 40px;
    height: 40px;
    background: var(--gradient-mixed);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    animation: pulse-glow 3s infinite;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--duration-base);
    font-weight: 500;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-mixed);
    transform: translateX(-50%);
    transition: width var(--duration-base);
}

.nav-link:hover {
    color: var(--emerald-600);
    background: rgba(16, 185, 129, 0.08);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link.active {
    color: var(--emerald-600);
    background: rgba(16, 185, 129, 0.1);
    font-weight: 600;
}

/* ==================== MAIN LAYOUT ==================== */
.main-container {
    margin-top: 80px;
    position: relative;
    z-index: 1;
}

/* ==================== Panel Tabs Navigation ==================== */
.panel-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(to bottom, var(--bg-base), transparent);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-base);
    box-shadow: var(--shadow-xs);
}

.tab-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--emerald-400);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

.tab-button i {
    display: inline-flex;
}

/* Hide sections by default */
.converter-section,
.planner-section,
.palette-section {
    display: none;
}

.converter-section.active-section,
.planner-section.active-section,
.palette-section.active-section {
    display: block !important;
}

/* Ensure content sections are always visible */
.content-section {
    display: block !important;
}

.content-section section {
    display: block !important;
}

/* ==================== CONVERTER SECTION ==================== */
.converter-section {
    padding: 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: slide-up 0.6s ease;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.converter-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Control Panel */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-card {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all var(--duration-base);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.control-card:hover {
    border-color: var(--emerald-400);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.control-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.control-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.control-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Upload Area */
.upload-zone {
    border: 2px dashed var(--emerald-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--duration-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-mixed);
    border-radius: var(--radius-lg);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-base);
}

.upload-zone:hover {
    border-color: var(--emerald-500);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(245, 158, 11, 0.03) 100%);
    transform: scale(1.01);
}

.upload-zone:hover::before {
    opacity: 0.1;
}

.upload-zone.dragover {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Color Palette Grid */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

/* Color Tiles */
.color-tile {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-base);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    box-shadow: var(--shadow-xs);
}

.color-tile:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.color-tile.selected {
    border: 3px solid var(--emerald-500);
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), var(--shadow-lg);
    z-index: 3;
}

.color-tile.selected::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--emerald-500);
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.color-tile.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.color-tile.locked:hover {
    transform: scale(1);
}

.color-tile .lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.color-tile.transparent {
    background: repeating-conic-gradient(#f0f0f0 0% 25%, white 0% 50%) 50% / 10px 10px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-base);
    position: relative;
    overflow: hidden;
}

.color-swatch::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-base);
}

.color-swatch:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.color-swatch.selected {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--color-primary);
}

/* Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.magic-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: linear-gradient(to right, var(--emerald-100) 0%, var(--amber-100) 100%);
    outline: none;
}

.magic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all var(--duration-base);
}

.magic-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

/* Preview Panel */
.preview-panel {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border: 1px solid var(--border-default);
    position: relative;
    overflow: hidden;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem;
    color: var(--text-muted);
    width: 100%;
    height: 100%;
}

.preview-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-default);
    display: none;  /* Hide by default until image is uploaded */
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1200px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-mixed);
    opacity: 0.5;
}

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

.content-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    transition: all var(--duration-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-mixed);
    transform: scaleX(0);
    transition: transform var(--duration-base);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--emerald-400);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.12);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* How It Works Steps */
.how-it-works {
    margin: 5rem 0;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    transition: all var(--duration-base);
    box-shadow: var(--shadow-sm);
}

.step:hover {
    transform: translateY(-10px);
    border-color: var(--emerald-400);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
}

.step-number {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-mixed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

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

.step p {
    color: var(--text-secondary);
}

/* FAQ Section */
.faq-section {
    margin: 5rem 0;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    transition: all var(--duration-base);
    box-shadow: var(--shadow-xs);
}

.faq-item:hover {
    border-color: var(--emerald-400);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tutorial Cards */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.tutorial-card {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--duration-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tutorial-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-base);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    border-color: var(--amber-400);
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.12);
}

.tutorial-card:hover::after {
    transform: scaleX(1);
}

.tutorial-link {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap var(--duration-base);
}

.tutorial-link:hover {
    gap: 1rem;
}

/* Use Cases */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.use-case {
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--border-default);
    border-left: 4px solid var(--emerald-500);
    border-radius: var(--radius-lg);
    transition: all var(--duration-base);
    box-shadow: var(--shadow-xs);
}

.use-case:hover {
    transform: translateX(10px);
    border-left-color: var(--amber-500);
    box-shadow: var(--shadow-md);
}

/* ==================== PIXEL PLANNER SECTION ==================== */
.planner-section {
    padding: 2rem;
}

.planner-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tools-panel {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.tools-panel h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.tool-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.tool-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    cursor: pointer;
    transition: all var(--duration-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--text-secondary);
}

.tool-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.tool-btn.active {
    border-color: var(--color-primary);
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-primary);
}

.canvas-panel {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.canvas-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-default);
}

#drawingCanvas {
    border-radius: var(--radius-md);
    cursor: crosshair;
    background: white;
}

#gridOverlay {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    pointer-events: none;
    opacity: 0.3;
}

.color-selector h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.current-color {
    width: 100%;
    height: 60px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-default);
    background: #000000;
}

.quick-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.quick-color-tile {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-base);
    border: 2px solid transparent;
}

.quick-color-tile:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.quick-color-tile.selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
}

.action-buttons button {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--duration-base);
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-success {
    background: var(--gradient-primary);
    color: white;
}

.canvas-stats {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-default);
}

.stats-header h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== COLOR PALETTE SECTION ==================== */
.palette-section {
    padding: 2rem;
}

.palette-layout {
    max-width: 1200px;
    margin: 0 auto;
}

.palette-header {
    margin-bottom: 2rem;
}

.palette-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    width: fit-content;
    margin: 0 auto;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.palette-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--duration-base);
    font-weight: 500;
}

.palette-tab:hover {
    color: var(--text-primary);
}

.palette-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.colors-display {
    margin-bottom: 2rem;
}

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

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

.color-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration-base);
    cursor: pointer;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xs);
}

.color-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--emerald-400);
}

.color-preview {
    height: 80px;
    position: relative;
}

.color-info {
    padding: 0.75rem;
}

.color-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.color-hex {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

.lock-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: linear-gradient(135deg, var(--emerald-50) 0%, var(--amber-50) 100%);
    padding: 12px 0;
    margin-top: 80px;
    border-bottom: 1px solid var(--border-default);
}

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

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 12px;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--emerald-600);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--emerald-700);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Content Section Styles */
.content-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.content-section section {
    margin: 60px 0;
}

/* Container for content sections */
.content-section .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Introduction Section */
.intro-section {
    text-align: center;
    padding: 60px 40px;
    margin: 80px 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.intro-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--emerald-100) 0%, transparent 70%);
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

.section-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--emerald-500) 0%, var(--amber-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Section Headers */
.section-header-modern {
    text-align: center;
    margin-bottom: 3rem;
}

.section-icon-header {
    display: inline-flex;
    padding: 1rem;
    background: linear-gradient(135deg, var(--emerald-100) 0%, var(--amber-100) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

/* Palette Info Section */
.palette-info-section {
    margin: 100px 0;
}

.palette-explanation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.palette-type {
    padding: 2rem;
    position: relative;
}

.palette-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.palette-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.palette-type p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.color-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Technical Section */
.technical-section {
    margin: 100px 0;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tech-card {
    padding: 2rem;
    position: relative;
}

.tech-icon {
    display: inline-flex;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--emerald-100) 0%, var(--amber-100) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.tech-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tech-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Related Tools Section */
.related-tools {
    margin: 100px 0 60px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.tool-item {
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-item:hover {
    transform: translateY(-5px);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tool-header strong {
    font-size: 1.125rem;
    color: var(--text-primary);
}

.tool-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Animation for pulse effect */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

/* Responsive adjustments for content sections */
@media (max-width: 768px) {
    .content-section {
        padding: 40px 0;
    }
    
    .content-section section {
        margin: 40px 0;
    }
    
    .intro-section {
        padding: 40px 20px;
        margin: 40px auto;
    }
    
    .section-title {
        font-size: 1.875rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .palette-explanation,
    .tech-grid,
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .palette-info-section,
    .technical-section,
    .related-tools {
        margin: 60px 0;
    }
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, white 100%);
    border-top: 1px solid var(--border-default);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links h4,
.footer-resources h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-links ul,
.footer-resources ul {
    list-style: none;
}

.footer-links a,
.footer-resources a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration-base);
    display: inline-block;
    padding: 0.25rem 0;
}

.footer-links a:hover,
.footer-resources a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 2rem 2rem 0;
    border-top: 1px solid var(--border-default);
    text-align: center;
    color: var(--text-muted);
}

/* Usage Instructions for Color Palette */
.usage-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.usage-instructions h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.usage-instructions h3 i {
    color: var(--color-primary);
}

.usage-instructions ol {
    list-style: none;
    counter-reset: steps;
    padding: 0;
    margin: 0;
}

.usage-instructions li {
    counter-increment: steps;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.usage-instructions li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.usage-instructions strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

/* Palette Controls Fixes */
.palette-selector {
    position: relative;
    z-index: 5;
    margin: 1rem 0;
}

.palette-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all var(--duration-base);
    position: relative;
    z-index: 5;
}

.palette-dropdown:hover {
    border-color: var(--color-primary);
}

.palette-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.palette-import {
    position: relative;
    z-index: 5;
    margin-top: 1.5rem;
}

.url-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    transition: all var(--duration-base);
    position: relative;
    z-index: 5;
}

.url-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.import-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.btn-import, .btn-create {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-base);
    position: relative;
    z-index: 5;
    border: none;
}

.btn-import {
    background: var(--gradient-primary);
    color: white;
}

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

.btn-create {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-create:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}