/* Epaper Listing */
.epaper-list-header {
    text-align: center;
    margin-bottom: 2rem;
}

.epaper-list-header h2 {
    font-size: 1.5vw;
    color: #333;
}

.epaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.epaper-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.epaper-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.epaper-thumbnail {
    height: 300px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.epaper-thumbnail img {
    width: 100%;
    /* height: 100%; */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.epaper-item:hover .epaper-thumbnail img {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    text-align: center;
    padding: 1rem;
    color: #666;
}

.epaper-meta {
    padding: 1rem;
    text-align: center;
}

.epaper-meta h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #222;
}

.epaper-meta p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Epaper Details */
.epaper-details-header {
    text-align: center;
}

.epaper-details-header h2 {
    font-size: 3vh;
    color: #333;
    margin-bottom: 0.5rem;
}

.epaper-date {
    color: #666;
    font-size: 1.1rem;
}

.epaper-viewer {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .epaper-thumbnail {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .epaper-grid {
        grid-template-columns: 1fr;
    }
}


.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loading-spinner p {
    margin-top: 15px;
    color: #666;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.error-message p {
    margin-bottom: 20px;
}

.retry-button {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.retry-button:hover {
    background-color: #c82333;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.back-button {
    display: inline-block;
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}

.critical-error {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.critical-error h2 {
    color: #dc3545;
}


/* PDF Grid Layout */
.all-published-news {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.epaper-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end;
}

.date-filter,
.search-filter {
    flex: 1;
    min-width: 250px;
}

.pdf-grid-container {
    margin-top: 20px;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pdf-thumbnail {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
}

.pdf-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pdf-thumbnail img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.pdf-thumbnail canvas {
    width: 100%;
    height: 300px;
    background: #f5f5f5;
    display: block;
}

.pdf-info {
    padding: 15px;
}

.pdf-info h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    color: #333;
}

.pdf-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:hover:not(.active) {
    background: #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .epaper-controls {
        flex-direction: column;
    }

    .date-filter,
    .search-filter {
        width: 100%;
    }
}

.epaper-hero {
    background-color: #f8f9fa;
    padding: 4vh 0;
    text-align: center;
    margin-bottom: 40px;
}

.epaper-hero h1 {
    font-size: 2vw;
    color: #333;
    margin-bottom: 15px;
}

.epaper-hero p {
    font-size: 1vw;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.epaper-viewer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.back-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #e9ecef;
    border-color: #ccc;
}

/* Mobile PDF Viewer */
@media (max-width: 768px) {
    .pdf-viewer-container {
        width: 100%;
        overflow-x: auto;
    }

    #pdf-viewer {
        width: 100%;
        min-width: 800px;
        /* Ensures PDF has enough space */
    }

    .pdf-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
        padding: 10px;
        background: #f5f5f5;
        position: sticky;
        bottom: 0;
    }

    .pdf-button {
        padding: 8px 15px;
        background: #2c3e50;
        color: white;
        border: none;
        border-radius: 4px;
    }

    .pdf-thumbnail-img {
        max-width: 100%;
        height: auto;
    }

    .thumbnail-placeholder {
        width: 100%;
        height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #eee;
        color: #666;
    }
}


#pdf-viewer {
    overflow-y: scroll;
    max-height: 90vh;
}

#pdf-viewer canvas {
    width: 100% !important;
}

.pdf-controls {
    text-align: center;
    padding: 2vh;
}

.pdf-download {
    text-align: center;
    padding: 2vh;
}