@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Quicksand:wght@400;600;700&display=swap');

:root {
    /* Color Palette - Vibrant & Friendly */
    --primary-h: 210;
    --primary-s: 100%;
    --primary-l: 60%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    
    --secondary-h: 280;
    --secondary-s: 80%;
    --secondary-l: 65%;
    --secondary: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l));
    
    --accent-h: 150;
    --accent-s: 80%;
    --accent-l: 50%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    
    --bg-gradient: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    --magic-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    
    --text-main: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Glassmorphism Container */
.app-container {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 1000px;
    padding: 3rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo */
.logo {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1) rotate(-3deg);
}

/* Header & Typography */
h1 {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    background: var(--magic-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* Forms & Inputs */
.form-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    font-weight: 600;
    color: var(--text-main);
    padding-left: 0.5rem;
}

input, select {
    padding: 1.2rem;
    border-radius: 15px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 15px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
}

/* Buttons */
.magic-button {
    background: var(--magic-gradient);
    color: white;
    padding: 1.2rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Book View */
.book-view {
    display: none;
}

.book-view.active {
    display: block;
    animation: fadeIn 0.8s ease;
}

.story-content {
    font-family: 'Quicksand', sans-serif;
    line-height: 1.8;
    font-size: 1.3rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1.5rem;
    margin-top: 2rem;
}

.story-content p {
    margin-bottom: 1.5rem;
}

/* Custom Scrollbar */
.story-content::-webkit-scrollbar {
    width: 8px;
}
.story-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}
.story-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

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

/* Loader Animation */
.loader {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(0, 0, 0, 0.05);
    border-top: 8px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .app-container { padding: 1.5rem; }
}
