/* Custom styles for AI Book Builder for Kids */

/* Story container styling */
.story-container {
    font-family: 'Comic Neue', cursive;
    line-height: 1.8;
    color: #333;
}

/* Age-specific font sizes */
.age-3-5 .story-container {
    font-size: 1.4rem;
    line-height: 2;
}

.age-6-8 .story-container {
    font-size: 1.2rem;
    line-height: 1.8;
}

.age-9-12 .story-container {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Highlight styling for different topics */
.topic-animals .highlight {
    background-color: #d1fae5; /* Green */
    border-radius: 4px;
    padding: 0 4px;
}

.topic-fairy-tales .highlight {
    background-color: #ddd6fe; /* Purple */
    border-radius: 4px;
    padding: 0 4px;
}

.topic-science .highlight {
    background-color: #bfdbfe; /* Blue */
    border-radius: 4px;
    padding: 0 4px;
}

.topic-educational .highlight {
    background-color: #fef3c7; /* Yellow */
    border-radius: 4px;
    padding: 0 4px;
}

.topic-custom .highlight {
    background-color: #fee2e2; /* Red */
    border-radius: 4px;
    padding: 0 4px;
}

/* Book gallery card styling */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Ad space styling */
.ad-space-container {
    transition: all 0.3s ease;
}

#sidebarAdSpace, #mainAdSpace {
    transition: background-color 0.3s ease;
}

#sidebarAdSpace:hover, #mainAdSpace:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

/* Responsive ad adjustments */
@media (max-width: 768px) {
    #sidebarAdSpace {
        height: 250px !important;
    }
    
    #mainAdSpace {
        height: 100px !important;
    }
}

/* PDF styling */
.pdf-page {
    padding: 20px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pdf-title {
    font-size: 24px;
    font-weight: bold;
    color: #4f46e5;
    text-align: center;
    margin-bottom: 20px;
}

.pdf-content {
    font-size: 16px;
    line-height: 1.8;
}

.pdf-image {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

.pdf-footer {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 20px;
}

/* Animation for story generation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Mobile responsiveness enhancements */
@media (max-width: 640px) {
    .story-container {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .age-3-5 .story-container {
        font-size: 1.2rem;
        line-height: 1.8;
    }
    
    .pdf-title {
        font-size: 20px;
    }
    
    .pdf-content {
        font-size: 14px;
    }
}

/* Print styles for PDF download */
@media print {
    body {
        background-color: white;
        margin: 0;
        padding: 0;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    header, nav, footer, .book-gallery, button {
        display: none;
    }
    
    .story-container {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .highlight {
        background-color: transparent !important;
        font-weight: bold;
    }
    
    .pdf-page {
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 20px;
        page-break-after: always;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}