body.modal-open {
    overflow: hidden !important;
    height: 100vh;
}

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 30, 30, 0.65);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    position: relative;
    z-index: 100000;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.close-modal {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    font-size: 2rem;
    color: var(--neutral-500);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: white;
    box-shadow: var(--shadow-md);
}

.close-modal:hover {
    color: var(--neutral-900);
}

.story-container {
    padding: var(--space-xl);
}

.story-page {
    display: none;
}

.story-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.story-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--primary-700);
}

.page-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
}

.page-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--neutral-800);
    margin-bottom: var(--space-lg);
}

.story-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-top: 1px solid var(--neutral-200);
}

.nav-btn {
    background-color: var(--primary-500);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background-color: var(--primary-600);
}

.nav-btn:disabled {
    background-color: var(--neutral-300);
    cursor: not-allowed;
}

#page-indicator {
    font-weight: 600;
    color: var(--neutral-600);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet Responsive */
@media (max-width: 992px) {
    .modal-content {
        width: 95%;
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .story-container {
        padding: var(--space-md);
    }
    
    .page-image {
        max-height: 50vh;
    }
}