/* Premium CSS for E-Paper CMS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:wght@700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

h1, h2, h3, .brand-logo {
    font-family: 'Playfair Display', serif;
}

/* Navbar */
.navbar-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.brand-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a !important;
    letter-spacing: -0.5px;
}

/* Hero Section */
.hero-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: white;
    border-radius: 0 0 40px 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-epaper-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: rotate(2deg);
    transition: transform 0.3s ease;
}

.hero-epaper-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.hero-epaper-card img {
    border-radius: 8px;
    border: 1px solid #eee;
}

/* Filter Bar */
.filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

/* E-Paper Cards */
.epaper-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.epaper-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.epaper-thumb {
    height: 300px;
    width: 100%;
    object-fit: cover;
    object-position: top;
    border-bottom: 1px solid #eee;
}

.epaper-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.epaper-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.epaper-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.epaper-meta {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 20px;
}

.epaper-meta span {
    display: inline-block;
    background: #f0f2f5;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 5px;
    font-size: 0.8rem;
}

.read-btn {
    margin-top: auto;
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
}

.read-btn:hover {
    background: #b21f1f;
    color: #fff;
}

/* Reader UI */
.reader-container {
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: #2a2a2a;
}

.reader-sidebar {
    width: 140px;
    background: #1f1f1f;
    border-right: 1px solid #333;
    overflow-y: auto;
    padding: 10px;
}

.page-thumb {
    width: 100%;
    margin-bottom: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.page-thumb.active {
    border-color: #fdbb2d;
}

.page-number-label {
    text-align: center;
    color: #aaa;
    font-size: 0.8rem;
    margin-top: -10px;
    margin-bottom: 15px;
}

.reader-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.reader-toolbar {
    height: 60px;
    background: #1f1f1f;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid #444;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover, .toolbar-btn.active {
    background: #fdbb2d;
    color: #000;
    border-color: #fdbb2d;
}

.reader-content {
    flex-grow: 1;
    overflow: auto;
    padding: 30px;
}

/* Reader Toolbar Custom Pagination */
.reader-pagination .page-link {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
    font-size: 0.85rem;
    padding: 4px 10px;
}

.reader-pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: bold;
}

.reader-pagination .page-link:hover {
    background-color: #3a3a3a;
    color: #fff;
}

#pdf-render {
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: #fff; /* Ensure PDF background is white */
}

/* Mobile Responsiveness for Reader */
@media (max-width: 768px) {
    .reader-container {
        flex-direction: column;
    }
    
    .reader-main {
        min-height: 0; /* Prevent flex blowout */
        flex-grow: 1;
    }
    
    .reader-sidebar {
        width: 100%;
        height: 110px;
        flex-shrink: 0;
        border-right: none;
        border-top: 1px solid #333;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 15px;
        order: 2; /* Move it to the bottom */
    }
    
    /* Make thumbnails horizontal in sidebar */
    #thumbnails-container {
        display: flex;
        flex-direction: row;
        gap: 15px;
        align-items: center;
        width: max-content;
    }
    
    .page-thumb {
        width: auto;
        height: 80px;
        margin-bottom: 0;
        object-fit: contain;
    }
    
    .page-number-label {
        display: none; /* Hide labels to save space */
    }
    
    .reader-sidebar h5 {
        display: none; /* Hide "Pages" title */
    }
    
    .reader-toolbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
        align-items: stretch;
    }
    
    .reader-toolbar > div {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .toolbar-btn {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    .reader-content {
        padding: 15px;
    }
}
