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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #22d3ee;
    --export-color: #10b981;
    --export-hover: #059669;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

main {
    flex: 1;
}

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

.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    width: 100%;
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #4338ca);
}

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

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

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

.character-bio {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.bio-section {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: border-color 0.3s ease;
}

.bio-section:nth-child(1) {
    border-left-color: #6366f1;
}

.bio-section:nth-child(2) {
    border-left-color: #f59e0b;
}

.bio-section:nth-child(3) {
    border-left-color: #10b981;
}

.bio-section:nth-child(4) {
    border-left-color: #ef4444;
}

.bio-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.bio-section:nth-child(1) h2 {
    color: #a5b4fc;
}

.bio-section:nth-child(2) h2 {
    color: #fcd34d;
}

.bio-section:nth-child(3) h2 {
    color: #6ee7b7;
}

.bio-section:nth-child(4) h2 {
    color: #fca5a5;
}

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

.bio-section.generated p {
    color: var(--text-primary);
}

.export-section {
    text-align: center;
    margin-bottom: 2rem;
}

.btn-export {
    background: linear-gradient(135deg, var(--export-color), var(--export-hover));
    color: white;
    padding: 1rem 3rem;
}

.btn-export:hover {
    background: linear-gradient(135deg, var(--export-hover), #047857);
}

footer {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--surface-light);
    margin-top: auto;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bio-section.animate {
    animation: fadeIn 0.4s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .individual-controls {
        grid-template-columns: 1fr;
    }

    .btn-secondary {
        font-size: 0.95rem;
    }

    .bio-section {
        padding: 1.25rem;
    }

    .bio-section h2 {
        font-size: 1.1rem;
    }

    .btn-export {
        width: 100%;
    }
}

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

    .subtitle {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem 1rem;
    }

    .btn-primary {
        font-size: 1rem;
    }

    .bio-section {
        padding: 1rem;
    }
}

/* Focus states for accessibility */
.btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
