:root {
    --bg-main: #0f172a; /* Deep Slate */
    --bg-panel: #1e293b;
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #38bdf8; /* Sky Blue */
    --primary-hover: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--bg-panel);
    border-right: 1px solid var(--card-border);
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: 5px 0 20px rgba(0,0,0,0.3);
    z-index: 10;
    overflow-y: auto; /* Ensure sidebar is scrollable */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.control-group h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}
.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--card-border);
    border-radius: 6px;
}
.color-picker-wrapper span {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Select Input */
.select-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: 0.2s;
}
.select-input:focus {
    border-color: var(--primary);
}

/* Sliders */
.slider-container {
    margin-bottom: 20px;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-main);
}
.slider-header span {
    font-family: var(--font-mono);
    color: var(--primary);
    font-weight: 600;
}
input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    transition: 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Toggles */
.theme-toggles {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--card-border);
}
.btn-theme {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.btn-theme.active {
    background: var(--primary);
    color: #000;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Main Content & Background Presets */
.main-content {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #0f172a;
    transition: background 0.4s ease;
}

/* Preset: Mesh Gradient */
.main-content.bg-mesh {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%), 
        radial-gradient(at 0% 100%, hsla(339,49%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 100%, hsla(225,39%,30%,1) 0, transparent 50%);
}

/* Preset: Grid blueprint style */
.main-content.bg-grid {
    background-color: #0f172a;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
}

/* Preset: Modern Landscape image */
.main-content.bg-nature {
    background-image: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
}

/* Abstract Background Shapes */
.bg-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.8;
    animation: float 20s infinite alternate;
}
.shape-1 {
    width: 400px;
    height: 400px;
    background: #8b5cf6; /* Purple */
    top: 10%;
    left: 20%;
}
.shape-2 {
    width: 300px;
    height: 300px;
    background: #ec4899; /* Pink */
    bottom: 10%;
    right: 20%;
    animation-delay: -5s;
}
.shape-3 {
    width: 250px;
    height: 250px;
    background: #38bdf8; /* Blue */
    top: 40%;
    right: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.2); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

/* Glass Card */
.glass-card {
    position: relative;
    z-index: 1;
    width: 500px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: color 0.3s, background 0.1s, backdrop-filter 0.1s, border 0.1s, box-shadow 0.1s;
}
.glass-card.dark-text {
    color: #0f172a;
}
.glass-card.light-text {
    color: #ffffff;
}

.card-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.card-content p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

.css-output {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.glass-card.dark-text .css-output {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}
.css-output pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #38bdf8;
    white-space: pre-wrap;
    line-height: 1.6;
}
.glass-card.dark-text .css-output pre {
    color: #2563eb;
}
