/* ==========================================================================
   AFYA EPUB Reader - Stable Version 1.1.0
   ========================================================================== */

/* 1. Main Container Wrapper */
.afya-reader {
    max-width: 1000px;
    margin: 20px auto;
    border: 1px solid #ccc;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. Control Bar (Header) - Responsive Update */
.afya-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 1.5vw, 12px); 
    padding: clamp(8px, 2vw, 15px);
    background: #2c3e50;
    color: white;
    z-index: 10;
    flex-wrap: wrap; 
}

/* 3. Global Button Styling */
.afya-controls button {
    font-size: clamp(12px, 1.2vw, 14px);
    padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 10px);
    border: none;
    border-radius: 4px;
    background: #34495e;
    color: white;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.afya-controls button:hover {
    background: #1abc9c;
    transform: translateY(-1px);
}

.afya-controls button:active {
    transform: translateY(0);
}

/* 4. Visual Hierarchy (Specific Colors) */
#night { background: #8e44ad; } /* Purple */

/* Zoom Buttons - Unified Logic */
#fontMinus, #fontPlus {
    background: #2980b9; /* Bright Blue */
    font-family: monospace;
    font-size: clamp(14px, 2vw, 18px); 
    min-width: clamp(35px, 4vw, 50px);
}

/* 5. The Content Viewer Area - STABILIZED */
#flipbook {
    position: relative;
    margin: 0 auto;
    background-color: #fcfcfc;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    height: 750px; 
    width: 100%;
    display: block;
    overflow: hidden;
}

#flipbook iframe {
    border: none !important;
    vertical-align: bottom;
}

/* 6. Internal Iframe Fixes */
#flipbook iframe {
    border: none !important;
    vertical-align: bottom; /* Removes sub-pixel gaps */
}

/* 7. Mobile Responsive Adjustments */
@media (max-width: 600px) {
    #flipbook {
        /* 500px is the "Sweet Spot" for mobile readability 
           while keeping the website scrollable */
        height: 500px; 
    }
    
    .afya-controls {
        gap: 8px;
        padding: 8px;
    }
    
    .afya-controls button {
        padding: 6px 8px;
        font-size: 11px; /* Slightly smaller to prevent overspill */
    }

    #fontMinus, #fontPlus {
        min-width: 35px; /* Compact zoom buttons for small screens */
    }
}