﻿        @import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700&display=swap');

        :root {
            --primary: #4a90e2;
            --secondary: #6ac6c6;
            --accent: #ff9a3d;
            --light: #f8f9ff;
            --dark: #2d3047;
            --success: #4caf50;
            --warning: #ff9800;
            --danger: #f44336;
        }

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

        body {
            font-family: 'Nunito', sans-serif;
            background: linear-gradient(135deg, #f0f8ff, #e0f7fa);
            color: #333;
            line-height: 1.6;
            overflow-x: hidden;
            position: relative;
        }

        h1, h2, h3 {
            font-family: 'Fredoka One', cursive;
            color: var(--dark);
        }

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

        header {
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
        }

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

        .logo i {
            color: var(--secondary);
        }

        .nav-links {
            display: flex;
            gap: 25px;
            align-items: center;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--dark);
            font-weight: 600;
            transition: color 0.3s;
        }

        .nav-links a:hover {
            color: var(--primary);
        }

        .cta-button {
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 50px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
        }

        .cta-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(74, 144, 226, 0.6);
        }

        .hamburger {
            display: none;
            font-size: 1.8rem;
            cursor: pointer;
            color: var(--dark);
            transition: color 0.3s;
        }

        .hamburger:hover {
            color: var(--primary);
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .user-info img {
            width: 30px;
            height: 30px;
            border-radius: 50%;
        }

        #hero {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: relative;
            overflow: hidden;
            padding-top: 80px;
        }

        .hero-content {
            max-width: 800px;
            z-index: 2;
            position: relative;
        }

        .hero-content h1 {
            font-size: clamp(2.5rem, 5vw, 4.5rem);
            margin-bottom: 20px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: fadeInUp 1s ease-out;
        }

        .hero-content p {
            font-size: clamp(1.2rem, 2.5vw, 1.8rem);
            margin-bottom: 30px;
            color: var(--dark);
            animation: fadeInUp 1s ease-out 0.2s both;
        }

        .hero-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            animation: fadeInUp 1s ease-out 0.4s both;
        }

        .btn {
            padding: 12px 30px;
            border-radius: 50px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 1.1rem;
            text-decoration: none;
            display: inline-block;
        }

        .btn-primary {
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: white;
            border: none;
            box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
        }

        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(74, 144, 226, 0.6);
        }

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

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

        .btn-disabled {
            background: #ccc !important;
            cursor: not-allowed;
            box-shadow: none !important;
        }

        .animal-character {
            position: absolute;
            width: 100px;
            height: 100px;
            background-size: contain;
            background-repeat: no-repeat;
            z-index: 1;
            pointer-events: none;
            opacity: 0.5;
        }

        section {
            padding: 80px 0;
            position: relative;
        }

        .section-content {
            position: relative;
            z-index: 2;
        }

        .section-title {
            text-align: center;
            margin-bottom: 50px;
            position: relative;
        }

        .section-title h2 {
            font-size: 2.5rem;
            display: inline-block;
            position: relative;
        }

        .section-title h2:after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            border-radius: 2px;
        }

        #features {
            background: white;
        }

        .features-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
        }

        .feature-card {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s, box-shadow 0.3s;
            text-align: center;
            position: relative;
            overflow: hidden;
            z-index: 2;
        }

        .feature-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
        }

        .feature-icon {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2rem;
        }

        .feature-card h3 {
            margin-bottom: 15px;
            font-size: 1.5rem;
        }

        #how-it-works {
            background: linear-gradient(135deg, #f8f9ff, #e8f4ff);
        }

        .steps-container {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            position: relative;
        }

        .step {
            flex: 1;
            min-width: 250px;
            text-align: center;
            padding: 0 20px;
            position: relative;
            margin-bottom: 30px;
        }

        .step-number {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            font-weight: bold;
            margin: 0 auto 20px;
            position: relative;
            z-index: 2;
        }

        .step-content {
            background: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
            z-index: 2;
            position: relative;
        }

        .step-content h3 {
            margin-bottom: 10px;
            color: var(--primary);
        }

        #examples {
            background: white;
        }

        .examples-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
        }

        .example-card {
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s;
            position: relative;
            z-index: 2;
        }

        .example-card:hover {
            transform: scale(1.03);
        }

        .example-image {
            height: 200px;
            background-size: cover;
            background-position: center;
        }

        .example-content {
            padding: 20px;
            background: white;
        }

        .example-content h3 {
            margin-bottom: 10px;
            color: var(--primary);
        }

        #pricing {
            background: linear-gradient(135deg, #f8f9ff, #e8f4ff);
        }

        .pricing-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 30px;
        }

        .pricing-card {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            text-align: center;
            transition: transform 0.3s;
            position: relative;
            z-index: 2;
        }

        .pricing-card:hover {
            transform: translateY(-10px);
        }

        .pricing-card.active {
            border: 3px solid var(--success);
            box-shadow: 0 15px 40px rgba(0, 128, 0, 0.3);
        }

        .pricing-header {
            padding: 30px 20px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
        }

        .pricing-header h3 {
            font-size: 1.8rem;
            margin-bottom: 10px;
        }

        .price {
            font-size: 2.5rem;
            font-weight: 700;
        }

        .pricing-body {
            padding: 30px 20px;
        }

        .pricing-features {
            list-style: none;
            margin-bottom: 30px;
        }

        .pricing-features li {
            padding: 10px 0;
            border-bottom: 1px solid #eee;
        }

        .pricing-features li:last-child {
            border-bottom: none;
        }

        #tool, #preview {
            padding: 40px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin: 20px auto;
            max-width: 1000px;
            position: relative;
            z-index: 2;
        }

        #tool h1, #preview h1 {
            font-size: 2em;
            text-align: center;
            color: var(--primary);
            margin-bottom: 30px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--dark);
        }

        textarea, select, input {
            width: 100%;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 1em;
            font-family: 'Nunito', sans-serif;
        }

        textarea {
            height: 120px;
            resize: vertical;
        }

        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .checkbox-group input {
            width: auto;
        }

        .story-page {
            width: 210mm;
            min-height: 297mm;
            margin: 20px auto;
            padding: 15mm;
            background: white;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            position: relative;
            page-break-after: always;
            font-family: 'Comic', cursive;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .story-page h2 {
            font-size: 2.5em;
            text-align: center;
            margin-bottom: 20px;
            color: #4a90e2;
            font-family: 'Fredoka One', cursive;
        }

        .story-page p {
            font-size: 1.1em;
            line-height: 1.5;
            margin-bottom: 15px;
            text-align: justify;
        }

        .story-image {
            max-width: 100%;
            height: auto;
            border-radius: 10px;
            margin: 15px 0;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
.page-layout {
    display: flex;
    flex: 1;
    gap: 15mm;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12mm;
    border-radius: 12px;
    /* box-shadow: 0 0 6mm rgba(0, 0, 0, 0.05); */
    font-family: "Poppins", "Georgia", serif;
    line-height: 1.6;
    color: #2d2d2d;
}

/* Alternate text positions for visual rhythm */
.page-layout.text-left {
    flex-direction: row;
}

.page-layout.text-right {
    flex-direction: row-reverse;
}

.page-layout.text-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* âœ¨ Image styling */
.page-layout img {
    max-width: 50%;
    border-radius: 10px;
    box-shadow: 0 3mm 6mm rgba(0, 0, 0, 0.15);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.page-layout img:hover {
    transform: scale(1.03);
}

/* âœ¨ Text styling */
.page-layout .story-text {
    flex: 1;
    padding: 5mm;
    font-size: 14pt;
}

.page-layout.text-center .story-text {
    max-width: 70%;
}

/* ðŸŒˆ Optional: Add subtle borders or page effects */
.page-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.3), transparent 70%);
    border-radius: 12px;
    pointer-events: none;
}

        .text-content {
            flex: 1;
            font-size: 1.1em;
            line-height: 1.5;
            text-align: justify;
        }

        .image-content {
            flex: 0 0 auto;
            text-align: center;
            max-width: 100mm;
        }

        .summary-page {
            background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
            border: 3px dashed #4a90e2;
        }

        .summary-page h2 {
            color: #d81b60;
            margin-bottom: 30px;
        }

        .summary-content {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 15, 30, 0.95), rgba(0, 0, 0, 0.9));
    color: #00ffff;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    z-index: 9999;
    animation: overlayFade 0.5s ease-in-out;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

@keyframes overlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(0, 255, 255, 0.2);
    border-top: 6px solid #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 
                0 0 40px rgba(0, 255, 255, 0.3),
                inset 0 0 20px rgba(0, 255, 255, 0.2);
}

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

.processing-text {
    color: #00ffff;
    font-size: 1.4em;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    animation: textPulse 2s infinite ease-in-out;
    margin: 0;
}

@keyframes textPulse {
    0%, 100% { 
        opacity: 0.8;
        text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff, 0 0 45px #00ffff;
    }
}


        footer {
            background: var(--dark);
            color: white;
            padding: 50px 0 20px;
            position: relative;
            z-index: 2;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 40px;
            margin-bottom: 40px;
        }

        .footer-column h3 {
            color: white;
            margin-bottom: 20px;
            font-size: 1.3rem;
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }

        .footer-links a {
            color: #ccc;
            text-decoration: none;
            transition: color 0.3s;
        }

        .footer-links a:hover {
            color: white;
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }

        .social-links a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            color: white;
            transition: background 0.3s;
        }

        .social-links a:hover {
            background: var(--primary);
        }

        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.9rem;
            color: #aaa;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1001;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 15px;
            width: 90%;
            max-width: 400px;
            position: relative;
        }

        .modal-content h2 {
            margin-bottom: 20px;
            text-align: center;
            color: var(--primary);
        }

        .close {
            position: absolute;
            right: 15px;
            top: 15px;
            font-size: 24px;
            cursor: pointer;
            color: var(--dark);
        }

        .auth-form .form-group {
            margin-bottom: 15px;
        }

        .auth-form input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .auth-form button {
            width: 100%;
            margin-top: 10px;
        }

        .auth-toggle {
            text-align: center;
            margin-top: 15px;
            color: var(--primary);
            cursor: pointer;
        }

        .error-message {
            color: var(--danger);
            text-align: center;
            margin-bottom: 10px;
            display: none;
        }

        .google-signin {
            margin-top: 15px;
            text-align: center;
        }

        .google-signin a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: #fff;
            color: #3c4043;
            border: 1px solid #dadce0;
            border-radius: 10px;
            font-family: 'Roboto', sans-serif;
            font-size: 15px;
            font-weight: 500;
            text-decoration: none;
            padding: 12px 0;
            width: 280px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            transition: box-shadow 0.2s ease, background-color 0.2s ease;
        }

        .google-signin a:hover {
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            background-color: #f8f9fa;
        }

        .google-signin img {
            width: 20px;
            height: 20px;
            margin-right: 12px;
        }

        .flash-message {
            padding: 10px 20px;
            margin-bottom: 10px;
            border-radius: 5px;
            color: white;
            max-width: 300px;
        }

        .flash-message.success {
            background: var(--success);
        }

        .flash-message.error {
            background: var(--danger);
        }

        .flash-message.info {
            background: var(--primary);
        }

        /* Translation Icon Styles */
        .translation-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1002;
        }

        .translation-icon {
            background: var(--primary);
            color: white;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .translation-icon:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
        }

        .translation-dropdown {
            display: none;
            position: absolute;
            bottom: 60px;
            right: 0;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            width: 200px;
            padding: 10px 0;
            z-index: 1003;
        
    /* âœ… Scrollable behavior */
    max-height: 350px; /* adjust as needed */
    overflow-y: auto;
}

/* Optional: make the scrollbar look nicer */
.translation-dropdown::-webkit-scrollbar {
    width: 6px;
}
.translation-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.translation-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

        .translation-dropdown.active {
            display: block;
        }

        .translation-option {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            cursor: pointer;
            font-size: 1rem;
            color: var(--dark);
            transition: background 0.2s;
        }

        .translation-option:hover {
            background: var(--light);
        }

        .translation-option span.flag {
            margin-right: 10px;
            font-size: 1.2rem;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0) rotate(0); }
            50% { transform: translateY(-20px) rotate(3deg); }
        }

        @keyframes float2 {
            0%, 100% { transform: translateY(0) rotate(0); }
            50% { transform: translateY(-15px) rotate(-2deg); }
        }

        @keyframes float3 {
            0%, 100% { transform: translateY(0) rotate(0); }
            50% { transform: translateY(-25px) rotate(5deg); }
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes bounceIn {
            from { transform: scale(0.5); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.03); }
            100% { transform: scale(1); }
        }

        @media (max-width: 768px) {
            .hamburger {
                display: block;
            }

            .nav-links {
                display: none;
                flex-direction: column;
                position: absolute;
                top: 70px;
                left: 0;
                width: 100%;
                background: rgba(255, 255, 255, 0.95);
                padding: 20px;
                box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
                z-index: 999;
                align-items: center;
                transition: transform 0.3s ease-in-out;
                transform: translateY(-100%);
            }

            .nav-links.active {
                display: flex;
                transform: translateY(0);
            }

            .nav-links a, .nav-links .cta-button, .nav-links .user-info {
                padding: 10px 0;
                width: 100%;
                text-align: center;
            }

            .nav-links .cta-button {
                margin: 10px 0;
            }

            .nav-links .user-info {
                justify-content: center;
            }

            .hero-buttons {
                flex-direction: column;
                align-items: center;
            }

            .steps-container {
                flex-direction: column;
            }

            .step {
                margin-bottom: 40px;
            }

            .animal-character {
                width: 80px;
                height: 80px;
            }

            .story-page {
                width: 100%;
                padding: 10mm;
            }

            .page-layout {
                flex-direction: column;
            }

            .translation-dropdown {
                width: 180px;
            }
        }

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

            .hamburger {
                font-size: 1.5rem;
            }

            .nav-links a, .nav-links .cta-button {
                font-size: 1.1rem;
            }

            .hero-content h1 {
                font-size: clamp(2rem, 4vw, 3rem);
            }

            .hero-content p {
                font-size: clamp(1rem, 2vw, 1.4rem);
            }

            .btn {
                padding: 10px 20px;
                font-size: 1rem;
            }

            .section-title h2 {
                font-size: 2rem;
            }

            .feature-card, .pricing-card, .example-card {
                padding: 20px;
            }

            .feature-icon {
                width: 60px;
                height: 60px;
                font-size: 1.5rem;
            }

            .translation-container {
                bottom: 15px;
                right: 15px;
            }

            .translation-icon {
                width: 40px;
                height: 40px;
            }

            .translation-dropdown {
                width: 150px;
            }
        }
        .story-page {
    width: 720px;
    height: 960px;
    margin: 30px auto;
    /* border-radius: 25px; */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    /* border: 5px solid #ffd6e0; */
    background: radial-gradient(circle at top left, #fff7e6, #e0f7ff, #ffe6ff);
    background-size: 200% 200%;
    animation: gradientMove 12s ease infinite;
    font-family: "Poppins", "Comic Sans MS", cursive;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #ff69b4;
    font-size: 18px;
    padding: 25px 35px;
}

.page-number {
    font-size: 17px;
    color: #0096ff;
    text-shadow: 1px 1px 2px rgba(0, 150, 255, 0.3);
}

.text-content {
    width: 80%;
    /* margin: 100px auto 100px auto;  */
    text-align: center;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 12px rgba(255, 182, 193, 0.3);
}

.text-content p {
    margin: 18px 0;
}

.highlight {
    background: none !important;
    padding: 2px 6px;
    border-radius: 6px;
    color: #d6336c;
    font-weight: 600;
}

.page-footer {
    position: absolute;
    bottom: 20px;
    right: 50px;
    font-size: 15px;
    color: #666;
    font-style: italic;
}

.magic {
    color: #ff69b4;
    font-weight: bold;
}
.story-page {
    width: 750px;
    height: 980px;
    margin: 30px auto;
    /* border-radius: 25px; */
    /* border: 4px solid #ffd6e0; */
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); */
    background: linear-gradient(180deg, #fffaf5, #e8f6ff);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    font-family: "Poppins", "Comic Sans MS", cursive;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- TITLE PAGE ---------- */
.title-page {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    padding: 60px 20px;
}

.story-main-title {
    font-size: 42px;
    color: #ff4f81;
    text-shadow: 2px 2px 6px rgba(255, 79, 129, 0.4);
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.story-subtitle {
    font-size: 22px;
    color: #444;
    font-style: italic;
    margin-top: 20px;
}

.story-image {
    max-height: 350px;
    width: auto;
    margin-top: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ---------- PAGE HEADER (Title + Number in one row) ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px 10px 40px;
    border-bottom: 2px solid #ffb3c6;
}

.page-number {
    font-size: 16px;
    color: #007bff;
    font-weight: bold;
}

/* ---------- TEXT SECTION ---------- */
.text-section {
    flex-grow: 1;
    display: flex;
    align-items: center; /* vertical centering */
    justify-content: center;
}

.text-content {
    width: 88%;
    margin: 0 auto;
    color: #333;
    font-size: 17px;
    line-height: 1.8;
    text-align: justify;
    background: rgba(255, 255, 255, 0.85);
    padding: 45px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.3);
}

.text-content p {
    margin: 18px 0;
}

/* Highlighted words */
.highlight {
    background: none !important;
    padding: 2px 6px;
    border-radius: 6px;
    color: #d6336c;
    font-weight: 600;
}

/* ---------- FOOTER ---------- */
.page-footer {
    text-align: right;
    font-size: 15px;
    color: #666;
    font-style: italic;
    padding: 20px 35px;
}

.magic {
    color: #ff69b4;
    font-weight: bold;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px 10px 40px;
    border-bottom: 2px solid #ffb3c6;
    margin-bottom: 25px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}


.page-number {
    font-size: 18px;
    color: #007bff;
    font-weight: 600;
    text-align: right;
}

/* Center the text section properly */
.text-section {
    flex-grow: 1;
    display: flex;
    align-items: center;      /* vertical center */
    justify-content: center;  /* horizontal center */
    padding: 20px 0;
}

.text-content {
    width: 82%;  /* wider text area */
    color: #333;
    font-size: 17px;
    line-height: 1.8;
    text-align: justify;
    background: rgba(255, 255, 255, 0.85);
    padding: 45px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.3);
}
/* Ensure header always stays horizontal */
.page-header {
    display: flex !important;             /* override any inherited block layout */
    flex-direction: row !important;       /* horizontal row */
    justify-content: space-between;       /* title on left, page number on right */
    align-items: center;                  /* vertical alignment */
    width: 90%;
    margin: 25px auto 10px auto;
    padding: 0 10px;
}

/* Make sure parent doesn't override it */
.page-layout {
    display: flex;
    flex-direction: column; /* keep overall layout vertical (header, text, footer) */
    height: 100%;
}

.story-page {
    width: 720px;
    height: 960px;
    margin: 30px auto;
    /* border-radius: 25px; */
    /* border: 4px solid #ffd6e0; */
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); */
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fffaf5, #f0f9ff);
    font-family: "Poppins", "Comic Sans MS", cursive;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header Row */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px 0 50px;
}

.page-number {
    font-size: 18px;
    color: #007bff;
    font-weight: 600;
}

/* Line below header */
.header-line {
    width: 85%;
    margin: 10px auto;
    border: none;
    border-top: 2px solid #ffc2d1;
    border-radius: 2px;
}

/* Text section centered */
.text-section {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-content {
    width: 85%;
    font-size: 17px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    background: rgba(255, 255, 255, 0.85);
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.25);
}

.text-content p {
    margin: 15px 0;
}

.highlight {
    background: none !important;
    padding: 2px 6px;
    border-radius: 6px;
    color: #d6336c;
    font-weight: 600;
}

/* Footer */
.page-footer {
    text-align: right;
    font-size: 15px;
    color: #666;
    font-style: italic;
    padding: 20px 40px;
}

.magic {
    color: #ff69b4;
    font-weight: bold;
}
.story-page {
    width: 720px;
    height: 960px;
    margin: 30px auto;
    /* border-radius: 25px; */
    border: 4px solid #ffd6e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    background: linear-gradient(180deg, #fffaf5, #f0f9ff);
    font-family: "Poppins", "Comic Sans MS", cursive;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Layout container */
.page-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
     /* background: linear-gradient(135deg, #FFF7E6 0%, #E6F7FF 100%) !important; */
}

/* Header (title left, number right) */
.page-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    width: 88%;
    margin: 25px auto 15px auto;
    padding: 0 10px;
    border-bottom: 2px solid #ffc2d1;
}

/* Title with improved color */
.page-title {
    font-size: 16px;
    font-weight: 700;
}

.page-number {
    font-size: 16px;
    color: #007bff;
    font-weight: 600;
}

/* Text area */
.text-section {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-content {
    width: 100%;
    font-size: 16px;            /* smaller text size */
    line-height: 1.7;
    color: #333;
    text-align: justify;
    background: none;
    padding: 15px 25px;
    margin-top: -150px;
}

.text-content p {
    margin: 15px 0;
}

/* Highlight special words */
.highlight {
    background: none important;
    padding: 2px 5px;
    border-radius: 6px;
    color: #d6336c;
    font-weight: 600;
}

/* Footer */
.page-footer {
    text-align: right;
    font-size: 14px;
    color: #555;
    font-style: italic;
    padding: 20px 40px;
    margin-bottom: 100px;
}

.magic {
    color: #ff69b4;
    font-weight: bold;
}

/* --- Title (Cover) Page --- */
.title-layout {
    text-align: center;
    padding-top: 80px;
}

.story-image {
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0 0 25px 0;
    display: block;
    border-radius: 0 0 25px 25px; /* gentle round only at bottom */
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    object-fit: cover;
}

.subtitle {
    font-size: 20px;
    color: #666;
    font-style: italic;
    margin-bottom: 60px;
}
/* --- Cover Page (Title Layout) --- */
.title-layout {
    text-align: center;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

/* Centered main title */
.main-title {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 40px;
    text-shadow: 1px 1px 5px rgba(255, 120, 120, 0.3);
}
.story-image {
    width: 100%;                    /* Stretch to full width */
    height: 80vh;                   /* Take up 80% of the page height */
    object-fit: cover;              /* Fill area â€” stretches while keeping focus centered */
    object-position: center;        /* Keeps the image centered while filling */
    display: block;
    margin: 0 auto 30px auto;       /* Centers image block */
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}



/* Subtitle below image */
.subtitle {
    font-size: 20px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    margin-bottom: 40px;
}

/* Footer remains subtle */
.page-footer {
    text-align: right;
    font-size: 14px;
    color: #555;
    font-style: italic;
    padding: 20px 40px;
}
.text-content {
    box-shadow: none !important;
}
.page-layout img {
    max-width: 100% !important;
}
/* Remove background from title page heading */
.story-page h2,
.page-title {
    background: none !important;
}

/* Remove background from header section */
.page-header {
    box-shadow: none !important;
}
.story-page{
         background: linear-gradient(135deg, #FFF7E6 0%, #E6F7FF 100%) !important;
}
.page-layout{
    background: transparent !important;
}
.summary-content{
    margin-bottom: 120px !important;
}
.page-title{
    color: linear-gradient(90deg, #ff477e, #ff9f43) !important;
    background-color: transparent !important;
}
.main-title{
    color: linear-gradient(90deg, #ff477e, #ff9f43) !important;
    background-color: transparent !important;
}
