/* Story Page Styles */

.story-content {
    background-color: var(--card-background) !important;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Ensure dark mode background is applied */
html[data-theme="dark"] .story-content {
    background-color: #2d3748 !important;
    color: #e2e8f0;
}

html[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #e2e8f0;
}

.story-header {
    display: block; /* Override any flex from main.css */
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.story-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

html[data-theme="dark"] .story-header h2 {
    color: #e2e8f0;
}

.story-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.story-tag {
    background-color: #e8f4f8;
    color: #2980b9;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

[data-theme="dark"] .story-tag {
    background-color: #2d3748;
    color: #4299e1;
}

.story-info {
    display: block;
    clear: both;
    background-color: var(--hover-color);
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--secondary-color);
    margin-top: 1rem;
}

.story-info p {
    display: block;
    margin: 0;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.8;
}

.story-info-wrapper {
    margin-top: 1rem;
}

.story-info-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.story-info-toggle:hover {
    background-color: var(--hover-color);
}

.story-info-toggle .toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

/* Story Body */
.story-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.story-scene {
    margin-bottom: 3rem;
}

.scene-background {
    margin-bottom: 1.5rem;
}

.background-note {
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    padding: 0.5rem;
    background-color: var(--hover-color);
    border-radius: 4px;
    text-align: center;
}

/* Dialog Blocks */
.dialog-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-left: 3px solid var(--secondary-color);
    position: relative;
}

.dialog-block.narration {
    border-left-color: #95a5a6;
    background-color: var(--hover-color);
}

[data-theme="dark"] .dialog-block.narration {
    border-left-color: #a0aec0;
}

.speaker {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

html[data-theme="dark"] .speaker {
    color: #4299e1;
}

.dialog-text {
    color: var(--text-color);
    line-height: 1.8;
}

.narration .dialog-text {
    color: var(--text-color);
    opacity: 0.9;
}

/* Subtitle Blocks */
.subtitle-block {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #2c3e50;
    color: white;
    border-radius: 4px;
}

.subtitle-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Story Navigation */
.story-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.story-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-prev,
.btn-next {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-prev:hover,
.btn-next:hover {
    background-color: #2980b9;
}

html[data-theme="dark"] .btn-prev,
html[data-theme="dark"] .btn-next {
    background-color: #4299e1;
    color: #1a1a1a;
}

html[data-theme="dark"] .btn-prev:hover,
html[data-theme="dark"] .btn-next:hover {
    background-color: #63b3ed;
    color: #1a1a1a;
}

.btn-prev {
    margin-right: auto;
}

.btn-next {
    margin-left: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .story-content {
        padding: 1rem;
    }
    
    .story-header h2 {
        font-size: 1.4rem;
    }
    
    .story-body {
        font-size: 1rem;
    }
    
    .dialog-block {
        padding: 0.75rem;
    }
    
    .speaker {
        font-size: 1rem;
    }
    
    .story-navigation {
        flex-direction: column;
    }
    
    .btn-prev,
    .btn-next {
        width: 100%;
        text-align: center;
        margin: 0;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .breadcrumb,
    .story-navigation {
        display: none;
    }
    
    .story-content {
        box-shadow: none;
        padding: 0;
    }
    
    .dialog-block {
        break-inside: avoid;
    }
}