/* FINAL CORRECTED STYLE.CSS - v3 */

/* General Body Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    padding-top: 60px;
    padding-bottom: 60px;
}

/* Header Styles */
.sticky-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px; background-color: #c00000; color: white; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 1000;
}
.logo { height: 40px; }
.menu-button { font-size: 28px; background: none; border: none; color: white; cursor: pointer; }

/* Main Content Area */
.epaper-container {
    padding: 15px;
    text-align: center;
    margin-top: 15px; /* Fix for content being blocked at the top */
}
#page-title { font-size: 1.2em; color: #333; margin-bottom: 10px; }
.page-viewer { max-width: 100%; overflow: auto; border: 1px solid #ccc; background: white; }
#epaper-page-image { max-width: 100%; display: block; }

/* Mobile Menu */
.mobile-nav { position: fixed; top: 60px; right: -250px; width: 200px; height: calc(100% - 60px); background-color: #444; padding: 20px; box-shadow: -2px 0 5px rgba(0,0,0,0.5); transition: right 0.3s ease-in-out; z-index: 999; }
.mobile-nav.open { right: 0; }
.mobile-nav a { display: block; color: white; text-decoration: none; font-size: 1.1em; margin-bottom: 15px; }

/* Share Modal Overlay - CRITICAL FIX IS HERE */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* This line hides the black overlay by default */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content { background-color: white; padding: 20px; border-radius: 8px; width: 90%; max-width: 500px; text-align: center; position: relative; }
.close-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 24px; cursor: pointer; }
.cropped-image-container { width: 100%; max-height: 200px; overflow-y: auto; border: 1px solid #ddd; margin: 15px 0; }
.cropped-image-container img { width: 100%; }
.share-link-container { background-color: #eee; padding: 10px; border-radius: 5px; margin-bottom: 15px; word-wrap: break-word; }
.share-actions, .social-share-buttons { display: flex; justify-content: center; gap: 10px; margin-top: 15px; }

/* Footer Styles */
.sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; height: 60px; background-color: #2d2d2d; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; box-shadow: 0 -2px 5px rgba(0,0,0,0.3); z-index: 1000; white-space: nowrap; }
.footer-left, .footer-right { display: flex; align-items: center; gap: 8px; }
#page-select-box { background-color: white; color: #333; padding: 8px 12px; border-radius: 4px; font-size: 16px; font-weight: bold; cursor: pointer; min-width: 90px; text-align: center; }
.nav-arrow { background-color: white; color: #c00000; border: none; border-radius: 4px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.action-btn { background-color: #c00000; color: white; border: none; border-radius: 4px; width: 45px; height: 45px; font-size: 22px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.action-btn:hover { background-color: #e00000; }
@media (max-width: 420px) { .sticky-footer { padding: 0 5px; } .footer-left, .footer-right { gap: 4px; } #page-select-box { min-width: 75px; padding: 6px 8px; font-size: 14px; } .nav-arrow { width: 32px; height: 32px; font-size: 15px; } .action-btn { width: 38px; height: 38px; font-size: 18px; } }

/* Cropping Styles */
.cropper-view-box { outline: 2px dashed #007bff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); }
.cropper-face { cursor: grab; }
.cropper-container { position: relative; }
.crop-action-buttons-container { position: absolute; bottom: -50px; left: 50%; transform: translateX(-50%); background: rgba(10, 10, 10, 0.8); border-radius: 8px; padding: 8px; display: flex; gap: 10px; z-index: 10; }
.crop-action-buttons-container button { background: #fff; border: none; padding: 8px 16px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.crop-action-buttons-container button.confirm { background-color: #28a745; color: white; }
/* --- STYLES FOR DATE PICKER --- */
.date-picker-wrapper {
    position: relative;
    width: 45px; /* Same width as other action buttons */
    height: 45px; /* Same height as other action buttons */
}

/* Style the label to look exactly like our button */
#calendar-label {
    width: 100%;
    height: 100%;
}

/* Hide the actual date input but keep it functional */
#date-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Makes it invisible */
    cursor: pointer;
}

/* Adjust for smaller screens */
@media (max-width: 420px) {
    .date-picker-wrapper {
        width: 38px;
        height: 38px;
    }
}
/* --- STYLES FOR PAGE LIST DROPDOWN --- */
.page-list {
    position: absolute;
    bottom: 65px; /* Position it just above the footer */
    left: 10px; /* Align with the left edge of the footer */
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 240px; /* Limit height for scrollbar on many pages */
    overflow-y: auto;
    display: none; /* Hide it by default */
}

.page-list.visible {
    display: block; /* This class will be added by JS to show it */
}

.page-item {
    padding: 10px 25px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.page-item:last-child {
    border-bottom: none;
}

.page-item:hover {
    background-color: #f5f5f5;
}

/* Style for the currently active page in the list */
.page-item.active {
    background-color: #c00000;
    color: white;
    font-weight: bold;
}