/* Story-specific styles */

/* Story HTML content styling */
.story-html-content {
    font-family: 'Comic Sans MS', 'Comic Neue', cursive, sans-serif !important;
}

/* Make sure Comic Sans MS is applied to all elements inside HTML content */
.story-html-content * {
    font-family: 'Comic Sans MS', 'Comic Neue', cursive, sans-serif !important;
}

:root {
    --story-font: 'Comic Neue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Story Container */
.story-container {
    display: none;
    max-width: 800px;
    width: 100%;
    margin: 20px auto 40px;
    padding: 0 20px;
    overflow: hidden;
}

/* Story Header structure for mobile */
.story-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

/* Pagination Dots */
.pagination-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 15px;
    gap: 6px;
    order: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--kinzy-grey);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dot.active {
    background-color: var(--kinzy-purple);
}

.story-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--kinzy-purple);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.2;
}

.story-author {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid var(--primary-color);
}

.author-name {
    font-weight: 600;
    color: var(--text-color);
}

.story-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* Swiper Styles */
.swiper {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    background: transparent;
    overflow: hidden;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    min-height: 450px;
    background-color: var(--kinzy-white);
    border-radius: 20px;
    box-shadow: none;
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color);
}

/* Story Page Styles */
.story-page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: all 0.3s ease;
}

.story-image-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.story-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--kinzy-light-purple);
    transition: transform 0.3s ease;
}

.story-image:hover {
    transform: scale(1.02);
}

.story-text-container {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.story-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--kinzy-black);
    text-align: left;
    padding: 0 20px;
    max-width: 500px;
    font-weight: 500;
}

.story-title-page .story-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--kinzy-purple);
    text-align: center;
    padding: 0 20px;
}

.story-end-page .story-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Story Controls */
.story-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    padding-top: 20px;
}

.control-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.control-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.control-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.control-button.audio-btn {
    background-color: var(--kinzy-orange);
}

.control-button.audio-btn:hover {
    background-color: var(--kinzy-orange);
    opacity: 0.9;
}

.page-indicator {
    font-family: var(--story-font);
    font-weight: 600;
    color: var(--text-light);
}

/* Audio button positioned in top right of slide */
.slide-audio-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background-color: var(--kinzy-orange);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slide-audio-button:hover {
    background-color: var(--kinzy-orange);
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Page Navigation (for non-swipe fallback) */
.page-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 15px;
}

.nav-arrows {
    display: flex;
    gap: 30px;
    align-items: center;
}

/* Hide the audio button from the bottom navigation */
.nav-arrows .audio-btn {
    display: none;
}

/* Download App Section for Preview Mode - As a Slide */
.preview-app-slide {
    background: linear-gradient(135deg, var(--kinzy-purple) 0%, var(--kinzy-light-purple) 100%);
    color: var(--kinzy-white);
    padding: 40px 30px;
    text-align: center;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 450px;
}

.preview-app-slide .story-page-container {
    text-align: center;
    align-items: center;
    justify-content: center;
}

.preview-app-slide .preview-app-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
}

.preview-app-slide .preview-app-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
    opacity: 0.9;
    max-width: 400px;
    text-align: center;
}

.preview-app-slide .preview-app-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 0;
}

.preview-app-slide .preview-app-btn {
    display: flex;
    align-items: center;
    background-color: var(--kinzy-white);
    color: var(--kinzy-purple);
    padding: 12px 25px;
    border-radius: 25px;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-size: 14px;
}

.preview-app-slide .preview-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.preview-app-slide .preview-app-btn i {
    font-size: 18px;
}

/* Instructions Message - Setting display to none by default */
.instructions-message {
    display: none;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .story-title {
        font-size: 24px;
    }
    
    .story-text {
        font-size: 15px;
    }
    
    .story-title-page .story-text {
        font-size: 24px;
    }
    
    .story-end-page .story-text {
        font-size: 24px;
    }
    
    .swiper-slide {
        padding: 20px;
        min-height: 400px;
    }
    
    .story-image-container {
        margin-bottom: 15px;
    }
    
    .story-image {
        width: 150px;
        height: 150px;
    }
    
    .control-button {
        width: 40px;
        height: 40px;
    }
    
    .slide-audio-button {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
    }
    
    .preview-app-slide {
        padding: 30px 20px;
        min-height: 400px;
    }
    
    .preview-app-slide .preview-app-title {
        font-size: 20px;
    }
    
    .preview-app-slide .preview-app-text {
        font-size: 14px;
    }
    
    .preview-app-slide .preview-app-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .preview-app-slide .preview-app-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Move pagination dots to top for mobile */
    .story-header {
        display: flex;
        flex-direction: column;
    }
    
    .pagination-dots {
        order: -1;
        margin: 0 auto 15px;
    }
    
    .progress-container {
        order: 2;
    }
    
    .story-title {
        font-size: 20px;
        order: 1;
    }
    
    .story-author, .story-date {
        order: 3;
    }
    
    .story-text {
        font-size: 14px;
        padding: 0 15px;
    }
    
    .story-title-page .story-text {
        font-size: 20px;
    }
    
    .story-end-page .story-text {
        font-size: 20px;
    }
    
    .swiper-slide {
        padding: 15px;
        min-height: 350px;
    }
    
    .story-image {
        width: 180px;
        height: 180px;
    }
    
    .control-button {
        width: 36px;
        height: 36px;
    }
    
    .slide-audio-button {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .preview-app-slide {
        padding: 20px 15px;
        min-height: 350px;
    }
    
    .preview-app-slide .preview-app-title {
        font-size: 18px;
    }
    
    .preview-app-slide .preview-app-text {
        font-size: 13px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}