/* =============================================
   PDF LIBRARY MAIN STYLES (pdfs.php)
   ============================================= */
:root {
    --primary-color: #1a3e1a; /* Dark green */
    --secondary-color: #e67e22; /* Orange */
    --accent-color: #27ae60; /* Green */
    --dark-color: #0e2a0e; /* Darker green */
    --light-color: #f5f5f5;
    --text-color: #333;
    --text-light: #666;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    background-image: url('/../images/hero-1.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
}

/* Main content container */
main {
    background-color: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}
body {
    margin: 0;
    padding: 0;
}

/* if header is fixed at top */
main, .pdf-grid {
    margin-top: 80px; /* equal to or a bit larger than header height */
}

/* Header styles */
.pdf-library-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.pdf-library-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/hero-2.webp') center/cover;
    opacity: 0.1;
    z-index: 0;
}

.pdf-library-header h1 {
    color: white;
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.pdf-library-header p {
    margin: 0.8rem 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.search-box {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background-color: rgba(255,255,255,0.9);
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.3);
}

.search-box button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--dark-color);
    transform: translateY(-50%) scale(1.05);
}

/* Breadcrumb */
.breadcrumb {
    margin: 1rem 0 2rem;
    font-size: 0.95rem;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    background-color: rgba(255,255,255,0.8);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Main container */
.pdf-library-container {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    position: relative;
}

/* Sidebar with glass morphism effect */
.sidebar {
    flex: 0 0 220px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255,255,255,0.2);
    height: fit-content;
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar h3 i {
    font-size: 1.1rem;
}

.categories {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories li {
    margin: 0;
}

.categories a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: rgba(245,245,245,0.7);
    border: 1px solid rgba(0,0,0,0.05);
}

.categories a:hover,
.categories a.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(26, 62, 26, 0.2);
}

.categories a i {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* PDF Grid - Modern card layout */
.pdf-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    background-color: rgba(255,255,255,0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.no-results i {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.no-results p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.btn-clear {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    font-weight: 500;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(26, 62, 26, 0.2);
}

.btn-clear:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 62, 26, 0.3);
}

/* PDF Card Styles */
.pdf-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.pdf-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.pdf-cover {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.pdf-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pdf-card:hover .pdf-cover img {
    transform: scale(1.1);
}

.default-cover {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 3.5rem;
    opacity: 0.7;
}

.pdf-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1;
}

.pdf-badge.free {
    background-color: var(--accent-color);
}

.pdf-badge.paid {
    background-color: var(--secondary-color);
}

.pdf-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 0.8rem 0.5rem;
    opacity: 0;
    transition: var(--transition);
    gap: 0.5rem;
}

.pdf-card:hover .pdf-actions {
    opacity: 1;
}

.btn-view, .btn-download, .btn-purchase, .btn-copy-link {
    color: white;
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.btn-view:hover, .btn-copy-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
}

.btn-download {
    background: var(--primary-color);
}

.btn-download:hover {
    background: var(--dark-color);
    transform: translateY(-3px);
}

.btn-purchase {
    background: var(--secondary-color);
}

.btn-purchase:hover {
    background: #d35400;
    transform: translateY(-3px);
}

.pdf-info {
    padding: 1.2rem;
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pdf-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    line-height: 1.4;
    font-weight: 600;
}

.pdf-info h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.pdf-info h3 a:hover {
    color: var(--primary-color);
}

.pdf-author {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0 0 0.8rem;
}

.pdf-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

.pdf-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pdf-price {
    color: var(--secondary-color);
    font-weight: bold;
    margin: 0.8rem 0 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Pagination - Modern style */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 3rem 0 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination li {
    display: inline-flex;
}

.pagination a, 
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    color: var(--text-color);
    background: rgba(245,245,245,0.8);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pagination a:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(230, 126, 34, 0.2);
}

.pagination .active a,
.pagination .active span {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
    box-shadow: 0 3px 8px rgba(26, 62, 26, 0.2);
}

.pagination .disabled span {
    color: #999;
    background: rgba(245,245,245,0.5);
    border: 1px solid rgba(0,0,0,0.05);
    cursor: not-allowed;
    opacity: 0.7;
}

/* =============================================
   PDF VIEW PAGE STYLES (view-pdf.php) - UPDATED
   ============================================= */

.pdf-view-container {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
}

.pdf-sidebar {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.pdf-cover-large {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.8rem;
    box-shadow: var(--box-shadow);
    position: relative;
}

.pdf-cover-large img {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-meta-info {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.pdf-meta-info h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-meta-info p {
    margin: 0.8rem 0;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.pdf-meta-info p strong {
    color: var(--text-color);
    font-weight: 600;
    margin-right: 1rem;
}

.pdf-meta-info p span {
    color: var(--text-light);
    text-align: right;
}

.pdf-actions {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-download-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(26, 62, 26, 0.2);
}

.btn-download-large:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 62, 26, 0.3);
}

.btn-download-large.btn-paid {
    background: var(--secondary-color);
    box-shadow: 0 3px 10px rgba(230, 126, 34, 0.2);
}

.btn-download-large.btn-paid:hover {
    background: #d35400;
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

.btn-share, .btn-copy-link-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
    background: white;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.1);
    cursor: button;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-share:hover, .btn-copy-link-large:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.btn-copy-link-large.copied {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pdf-content {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.pdf-content h1 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    line-height: 1.3;
}

.pdf-author {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.pdf-description {
    margin-bottom: 2.5rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.pdf-description h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

/* UPDATED PDF VIEWER STYLES */
.pdf-viewer-container {
    margin: 2.5rem 0;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-container h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.pdf-viewer-wrapper {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 600px;
    position: relative;
}

.pdf-viewer-controls {
    display: flex;
    justify-content: flex-end;
    padding: 0.8rem;
    background: rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.btn-fullscreen {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-fullscreen:hover {
    background: var(--dark-color);
}

.pdf-viewer {
    width: 100%;
    flex-grow: 1;
    display: flex;
    min-height: 500px;
}

.pdf-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex-grow: 1;
}

/* Fullscreen mode */
.pdf-viewer-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

.pdf-viewer-wrapper.fullscreen .pdf-viewer {
    height: calc(100vh - 60px);
}

.pdf-viewer-wrapper.fullscreen .pdf-viewer-controls {
    padding: 1rem;
}

.pdf-viewer-note {
    font-size: 0.95rem;
    color: var(--text-light);
    padding: 1rem;
    text-align: center;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 0;
}

.pdf-viewer-note a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    margin-left: 0.3rem;
}

.pdf-viewer-note a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.pdf-locked, .pdf-not-found {
    background: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-locked i, .pdf-not-found i {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.pdf-locked p, .pdf-not-found p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-color);
    max-width: 500px;
}

.pdf-locked a, .pdf-not-found a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.pdf-locked a:hover, .pdf-not-found a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.admin-notice {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 1.5rem;
    background: #f9f9f9;
    padding: 0.8rem;
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
}

.related-pdfs {
    margin-top: 3.5rem;
}

.related-pdfs h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover img {
    transform: scale(1.05);
}

.default-cover-small {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    opacity: 0.7;
}

.related-card h4 {
    margin: 0;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.related-card a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.related-card a:hover {
    color: var(--primary-color);
}

/* =============================================
   RESPONSIVE IMPROVEMENTS FOR PDF VIEWER
   ============================================= */

@media (max-width: 1200px) {
    .pdf-viewer-wrapper {
        min-height: 550px;
    }
}

@media (max-width: 992px) {
    .pdf-view-container {
        flex-direction: column;
    }
    
    .pdf-sidebar {
        flex: 0 0 auto;
        margin-bottom: 2rem;
        position: static;
    }
    
    .pdf-viewer-wrapper {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .pdf-content {
        padding: 1.5rem;
    }
    
    .pdf-content h1 {
        font-size: 1.7rem;
    }
    
    .pdf-viewer-wrapper {
        min-height: 450px;
    }
    
    .pdf-viewer-note {
        padding: 0.9rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .pdf-content {
        padding: 1rem;
    }
    
    .pdf-content h1 {
        font-size: 1.5rem;
    }
    
    .pdf-viewer-wrapper {
        min-height: 400px;
    }
    
    .pdf-viewer-note {
        padding: 0.8rem;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .btn-fullscreen {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */

@media (max-width: 1200px) {
    .pdf-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .pdf-sidebar {
        flex: 0 0 260px;
    }
}

@media (max-width: 992px) {
    .pdf-library-container, .pdf-view-container {
        flex-direction: column;
    }
    
    .sidebar, .pdf-sidebar {
        flex: 0 0 auto;
        margin-bottom: 2rem;
        position: static;
    }
    
    .pdf-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* =============================================
   PDF LIBRARY MAIN STYLES (pdfs.php)
   ============================================= */

/* ... (keep all your existing :root variables and other styles until the media queries) ... */

@media (max-width: 768px) {
    .pdf-library-header {
        padding: 1.5rem 1rem;
    }
    
    .pdf-library-header h1 {
        font-size: 1.5rem;
    }
    
    /* Updated grid for small screens */
    .pdf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Ensure all cards have the same size */
    .pdf-card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .pdf-cover {
        height: 160px; /* Fixed height for consistency */
    }
    
    .pdf-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    .pdf-info h3 {
    font-weight: 300;
}
.pdf-info p {
    font-weight: 200;
}
    .pdf-content {
        padding: 1rem;
    }
    
    .pdf-content h1 {
        font-size: 1.6rem;
    }
    
    .pdf-viewer {
        min-height: 400px;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
}

@media (max-width: 576px) {
    /* For very small screens, keep the 2x2 layout but adjust spacing */
    .pdf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .pdf-card {
        margin: 0; /* Remove auto margins to ensure equal sizing */
        max-width: 100%; /* Allow cards to fill their grid cells */
    }
    
    .pdf-cover {
        height: 140px; /* Slightly smaller for very small screens */
    }
    .pdf-author {
        font-size: 0.7rem;
    }
    .pdf-content h1 {
        font-size: 1.5rem;
    }
    
    .pdf-description {
        font-size: 1rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination a, 
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
.btn-view, .btn-download, .btn-purchase, .btn-copy-link {
    width: 30px;
    height: 30px;
}
.pdf-badge.free {
    background-color: var(--accent-color);
     width: 45px;
    height: 30px;
    font-size: 0.7rem;
}
}
/* Add this new media query for intermediate sizes if needed */
@media (min-width: 577px) and (max-width: 767px) {
    .pdf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .pdf-cover {
        height: 160px;
    }
}

/* =============================================
   ANIMATIONS & MICROINTERACTIONS
   ============================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pdf-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

/* Delay animations for grid items */
.pdf-card:nth-child(1) { animation-delay: 0.1s; }
.pdf-card:nth-child(2) { animation-delay: 0.2s; }
.pdf-card:nth-child(3) { animation-delay: 0.3s; }
.pdf-card:nth-child(4) { animation-delay: 0.4s; }
.pdf-card:nth-child(5) { animation-delay: 0.5s; }
.pdf-card:nth-child(6) { animation-delay: 0.6s; }
.pdf-card:nth-child(7) { animation-delay: 0.7s; }
.pdf-card:nth-child(8) { animation-delay: 0.8s; }

/* Loading spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(26, 62, 26, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(230, 126, 34, 0.5);
    outline-offset: 3px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    z-index: 100;
    transition: transform 0.3s ease;
}

.skip-link:focus {
    transform: translateY(40px);
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .admin-header, .admin-sidebar, .pdf-actions, .btn-share, 
    .btn-copy-link-large, .sidebar, .search-box, .breadcrumb {
        display: none !important;
    }
    
    .pdf-view-container {
        display: block !important;
    }
    
    .pdf-content {
        width: 100% !important;
        padding: 0 !important;
    }
    
    body {
        background: none !important;
        font-size: 12pt;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}