/* CSS Variables - Green Theme */
:root {
    --background: oklch(0.9711 0.0074 80.7211);
    --foreground: oklch(0.3000 0.0358 30.2042);
    --card: oklch(0.9711 0.0074 80.7211);
    --card-foreground: oklch(0.3000 0.0358 30.2042);
    --primary: oklch(0.5234 0.1347 144.1672);
    --primary-foreground: oklch(1.0000 0 0);
    --secondary: oklch(0.9571 0.0210 147.6360);
    --secondary-foreground: oklch(0.4254 0.1159 144.3078);
    --muted: oklch(0.9370 0.0142 74.4218);
    --muted-foreground: oklch(0.4495 0.0486 39.2110);
    --accent: oklch(0.8952 0.0504 146.0366);
    --accent-foreground: oklch(0.4254 0.1159 144.3078);
    --border: oklch(0.8805 0.0208 74.6428);
    --input: oklch(0.8805 0.0208 74.6428);
    --ring: oklch(0.5234 0.1347 144.1672);
    --font-sans: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 0.5rem;
    --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
    --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
    --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
    --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
    --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    min-height: 100vh;
    color: var(--foreground);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--primary);
    padding: 24px 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-foreground);
    margin-bottom: 8px;
    font-weight: 700;
}

.tagline {
    color: var(--primary-foreground);
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 32px 0;
}

/* Generator Section */
.generator-section {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    background: var(--card);
    border-radius: calc(var(--radius) + 8px);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

/* Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.canvas-wrapper {
    background: var(--muted);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px;
    border: 1px solid var(--border);
}

#avatarCanvas {
    display: block;
    border-radius: var(--radius);
    image-rendering: pixelated;
}

.preview-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Buttons */
.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent);
}

/* Controls Panel */
.controls-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-height: 580px;
    overflow-y: auto;
    padding-right: 8px;
}

.controls-panel::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track {
    background: var(--muted);
    border-radius: 3px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* Control Group */
.control-group {
    background: var(--secondary);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
}

.control-group h3 {
    font-size: 0.9rem;
    color: var(--accent-foreground);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* Style Options */
.style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.style-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    color: var(--foreground);
}

.style-btn:hover {
    border-color: var(--primary);
    background: var(--accent);
}

.style-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
}

/* Color Options */
.color-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.color-options label {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
}

.preset-colors {
    display: flex;
    gap: 5px;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    border: 2px solid var(--border);
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Info Section */
.info-section {
    background: var(--card);
    border-radius: calc(var(--radius) + 8px);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.info-section h2 {
    color: var(--primary);
    margin: 28px 0 14px;
    font-size: 1.4rem;
    font-weight: 700;
}

.info-section h2:first-child {
    margin-top: 0;
}

.info-section p {
    color: var(--foreground);
    margin-bottom: 14px;
}

.info-section ol,
.info-section ul {
    color: var(--foreground);
    padding-left: 24px;
    margin-bottom: 14px;
}

.info-section li {
    margin-bottom: 8px;
}

.info-section strong {
    color: var(--accent-foreground);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.feature-card {
    background: var(--secondary);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* Footer */
footer {
    background: var(--primary);
    padding: 24px 0;
    text-align: center;
    color: var(--primary-foreground);
    margin-top: 32px;
}

footer p {
    margin: 4px 0;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 900px) {
    .generator-section {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        order: -1;
    }

    .controls-panel {
        max-height: none;
    }

    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .generator-section {
        padding: 16px;
    }

    .info-section {
        padding: 20px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .style-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}
