.iskra-container { max-width: 1200px; margin: 40px auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); overflow: hidden; font-family: system-ui, sans-serif; box-sizing: border-box; }
.iskra-container * { box-sizing: border-box; }
.iskra-book-layout { display: flex; flex-wrap: wrap; }

.iskra-book-sidebar { flex: 1 1 350px; background: #f8f9fa; padding: 40px; display: flex; flex-direction: column; align-items: center; border-right: 1px solid #edf2f7; }
.iskra-book-cover { width: 100%; display: flex; justify-content: center; margin-bottom: 30px; }
.iskra-book-cover img { max-width: 100%; max-height: 450px; object-fit: contain; border-radius: 8px; box-shadow: 0 15px 25px rgba(0,0,0,0.2); }
.iskra-cover-placeholder { width: 100%; height: 300px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #a0aec0; border-radius: 8px; }

.iskra-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.iskra-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; text-align: center; border-radius: 6px; font-weight: 600; text-decoration: none; cursor: pointer; transition: 0.2s; border: none; font-size: 0.9em; }
.iskra-btn-read { background: var(--iskra-primary); color: white; }
.iskra-btn-download { background: #e2e8f0; color: #2d3748; }
.iskra-btn:hover { transform: translateY(-2px); filter: brightness(0.95); }

.iskra-epub-help { margin-top: 20px; background: #fff; padding: 12px; border-radius: 6px; border: 1px solid #e2e8f0; font-size: 0.8em; color: #4a5568; width: 100%; line-height: 1.5; }

.iskra-book-info { flex: 1 1 500px; padding: 50px; }
.iskra-title { font-size: 2.5em; margin: 0 0 10px; color: #1a202c; line-height: 1.1; }
.iskra-author { font-size: 1.2em; color: #4a5568; margin-bottom: 5px; }
.iskra-collaborators { font-size: 0.9em; color: #718096; margin-bottom: 25px; }
.iskra-metadata { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #edf2f7; font-size: 0.9em; color: #718096; }
.iskra-excerpt { font-size: 1.1em; line-height: 1.7; color: #2d3748; margin-bottom: 40px; }

.iskra-payment-box { background: #f7fafc; border: 2px dashed #cbd5e0; padding: 25px; border-radius: 8px; }
.iskra-payment-box h3 { margin-top: 0; color: #2d3748; }
.iskra-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iskra-form-grid input { padding: 10px; border: 1px solid #cbd5e0; border-radius: 4px; width: 100%; }

.iskra-template-dark { background: #1a202c; color: #f7fafc; }
.iskra-template-dark .iskra-title, .iskra-template-dark .iskra-payment-box h3 { color: #fff; }
.iskra-template-dark .iskra-book-sidebar { background: #2d3748; border-color: #4a5568; }
.iskra-template-dark .iskra-author, .iskra-template-dark .iskra-excerpt { color: #a0aec0; }
.iskra-template-dark .iskra-metadata { border-color: #4a5568; }
.iskra-template-dark .iskra-btn-download { background: #4a5568; color: #fff; }
.iskra-template-dark .iskra-payment-box { background: #2d3748; border-color: #4a5568; }
.iskra-template-dark .iskra-epub-help { background: #2d3748; border-color: #4a5568; color: #a0aec0; }

#iskra-reader-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.95); z-index: 99999; display: flex; flex-direction: column; }
.iskra-reader-header { padding: 15px 20px; background: #111; color: white; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.iskra-reader-title { font-size: 1.1em; font-weight: 600; flex-grow: 1; }
.iskra-nav-controls { display: flex; gap: 10px; align-items: center; }
.iskra-nav-btn { background: #2b6cb0; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.iskra-nav-btn:hover { background: #2c5282; }
#iskra-close-reader { background: #e53e3e; color: white; border: none; padding: 10px 20px; font-size: 1em; border-radius: 5px; cursor: pointer; font-weight: bold; }

#iskra-reader-area { flex-grow: 1; position: relative; overflow: hidden; background: #f0f0f0; display: flex; }
#iskra-epub-viewer, #iskra-pdf-viewer { width: 100%; height: 100%; display: block; }

/* Arreglo para el contenedor interno de DearFlip */
.df-container { width: 100% !important; height: 100% !important; min-height: 500px; }

@media (max-width: 768px) {
    .iskra-book-layout { flex-direction: column; flex-wrap: nowrap; }
    .iskra-book-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #edf2f7; padding: 20px; flex: none; }
    .iskra-book-info { width: 100%; padding: 20px; flex: none; }
    .iskra-title { font-size: 1.8em; }
    .iskra-actions-grid { grid-template-columns: 1fr; }
    .iskra-form-grid { grid-template-columns: 1fr; }
    
    .iskra-reader-header { flex-direction: column; text-align: center; padding: 10px; }
    #iskra-close-reader { width: 100%; margin-top: 10px; }
    .iskra-nav-controls { width: 100%; justify-content: space-between; }
}
