.story-generator-frontend {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Styles */
.story-generator-frontend form {
    margin-bottom: 30px;
}

.story-generator-frontend .form-group {
    margin-bottom: 20px;
}

.story-generator-frontend label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.story-generator-frontend input[type="text"],
.story-generator-frontend select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.story-generator-frontend input[type="text"]:focus,
.story-generator-frontend select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.story-generator-frontend button {
    background: #2271b1;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.story-generator-frontend button:hover {
    background: #135e96;
}

.story-generator-frontend button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.story-generator-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 16px;
}

.story-generator-message.error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.story-generator-message.success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.story-generator-message.info {
    background: #cff4fc;
    border: 1px solid #b6effb;
    color: #055160;
}

.story-generator-message a.button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.story-generator-message a.button:hover {
    background: #135e96;
    color: #fff;
    text-decoration: none;
}

/* Loading animation */
.generating-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

.generating-indicator .dots {
    display: inline-block;
}

.generating-indicator .dots:after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Responsive styles */
@media (max-width: 768px) {
    .story-generator-frontend {
        margin: 20px auto;
        padding: 20px;
    }
}

.story-page .page-image {
    margin-bottom: 30px;
    margin-top: 80px;    
}

.story-page .page-image img, .elementor-widget-theme-post-featured-image img {
    border-radius: 12px !important;  
}

.story-page .page-text {
    font-size: 1.2em;
    line-height: 1.6;
}

.page-text.kindergarten {
    font-size: 1.5em;
    line-height: 2;
}

.page-text.grade-1 {
    font-size: 1.4em;
    line-height: 1.8;
}

.page-text.grade-2 {
    font-size: 1.3em;
    line-height: 1.6;
}

.page-text.grade-3 {
    font-size: 1.2em;
    line-height: 1.5;
}

.page-text.grade-4 {
    font-size: 1.1em;
    line-height: 1.5;
}

.story-admin-info, .admin-prompt-info {
    /*display: none;*/
}

@media print {
    /* Hide navigation */
    nav, .navigation, #header-navigation, header {
        display: none !important;
    }

    /* Hide footer */
    footer, .footer, #site-footer {
        display: none !important;
    }

    /* Optional: Adjust body margins if needed */
    body {
        margin: 100px 0 100px 0;
    }

    .story-page .page-image {
        margin-top: 20px;
        page-break-before: always;
        width: 80%;
        height: auto;
        text-align: center;
        border-radius: 12px;
        margin-left: 10%;
    }

    .page-text.kindergarten {
        font-size: 1.2em;
        line-height: 1.6;
    }
    
    .page-text.grade-1 {
        font-size: 1.2em;
        line-height: 1.6;
    }
    
    .page-text.grade-2 {
        font-size: 1.2em;
        line-height: 1.6;
    }
    
    .page-text.grade-3 {
        font-size: 1.2em;
        line-height: 1.5;
    }
    
    .page-text.grade-4 {
        font-size: 1.2em;
        line-height: 1.5;
    }

    .story-admin-info, .admin-prompt-info {
        display: none;
    }

}