/**
 * PDF Ebooks Manager Styles
 * Designed to match Jannah theme styling
 * Place this file in: /wp-content/plugins/pdf-ebooks-manager/css/
 */

/* ==========================================
   ARCHIVE PAGE STYLES
   ========================================== */

   .pdf-ebooks-archive-wrapper {
    padding: 30px 0;
    background: #f5f5f5;
}

.pdf-ebooks-archive-wrapper .page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
}

.pdf-ebooks-archive-wrapper .page-title {
    font-size: 32px;
    font-weight: 700;
    color: #222;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* Grid Layout */
.pdf-ebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .pdf-ebooks-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Ebook Card */
.pdf-ebook-card {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdf-ebook-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

/* PDF Preview */
.pdf-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    text-align: center;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-icon {
    width: 80px;
    height: 80px;
    color: #fff;
    opacity: 0.9;
}

.pdf-icon svg {
    width: 100%;
    height: 100%;
}

/* Content Area */
.pdf-ebook-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pdf-ebook-content .entry-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.4;
}

.pdf-ebook-content .entry-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pdf-ebook-content .entry-title a:hover {
    color: #667eea;
}

/* Author */
.ebook-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ebook-author .author-label {
    font-weight: 600;
    color: #888;
}

.ebook-author .author-name {
    color: #667eea;
    font-weight: 500;
}

/* Excerpt */
.ebook-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    flex: 1;
}

/* Meta Info */
.ebook-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.ebook-meta .file-size {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ebook-meta svg {
    color: #667eea;
}

/* Actions */
.ebook-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.ebook-actions .btn {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view {
    background: #667eea;
    color: #fff;
}

.btn-view:hover {
    background: #5568d3;
}

.btn-download {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-download:hover {
    background: #e0e0e0;
}

/* Pagination */
.pagination-wrapper {
    text-align: center;
    padding: 20px 0;
}

.pagination-wrapper .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-wrapper .page-numbers {
    padding: 8px 15px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .page-numbers.current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* No Ebooks Found */
.no-ebooks-found {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 5px;
}

.no-ebooks-found p {
    font-size: 18px;
    color: #666;
}


/* ==========================================
   SINGLE PAGE STYLES
   ========================================== */

.pdf-ebook-single-wrapper {
    padding: 40px 0;
    background: #f5f5f5;
}

.pdf-ebook-single {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* Header */
.pdf-ebook-single .entry-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    text-align: center;
}

.pdf-ebook-single .entry-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.3;
    color: #fff;
}

.ebook-author-single {
    font-size: 18px;
    margin-bottom: 15px;
    opacity: 0.95;
}

.ebook-author-single .author-label {
    font-weight: 400;
    opacity: 0.8;
}

.ebook-author-single .author-name {
    font-weight: 600;
    margin-left: 5px;
}

.ebook-meta-single {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 15px;
}

.ebook-meta-single .file-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content */
.pdf-ebook-single .entry-content {
    padding: 40px;
}

/* Download Section */
.pdf-download-section {
    text-align: center;
    margin-bottom: 40px;
}

.btn-download-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: #667eea;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-download-large:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: #fff;
}

.btn-download-large svg {
    width: 20px;
    height: 20px;
}

/* PDF Viewer */
.pdf-viewer-container {
    margin-bottom: 40px;
}

.pdf-viewer-container h3 {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.pdf-embed-wrapper {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    overflow: hidden;
}

.pdf-embed-wrapper iframe {
    display: block;
    border: none;
}

.pdf-embed-wrapper p {
    padding: 20px;
    text-align: center;
    color: #666;
}

.pdf-embed-wrapper p a {
    color: #667eea;
    text-decoration: underline;
}

/* Description */
.ebook-description {
    padding-top: 40px;
    border-top: 1px solid #e1e1e1;
}

.ebook-description h3 {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    margin: 0 0 20px;
}

.ebook-description p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* Footer Navigation */
.entry-footer {
    padding: 30px 40px;
    background: #f9f9f9;
    border-top: 1px solid #e1e1e1;
}

.ebook-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.ebook-navigation .nav-previous,
.ebook-navigation .nav-next {
    flex: 1;
}

.ebook-navigation .nav-next {
    text-align: right;
}

.ebook-navigation a {
    display: inline-block;
    padding: 10px 20px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ebook-navigation a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .pdf-ebook-single .entry-title {
        font-size: 28px;
    }
    
    .pdf-ebook-single .entry-header {
        padding: 30px 20px;
    }
    
    .pdf-ebook-single .entry-content {
        padding: 25px 20px;
    }
    
    .entry-footer {
        padding: 20px;
    }
    
    .ebook-navigation {
        flex-direction: column;
    }
    
    .ebook-navigation .nav-next {
        text-align: left;
    }
    
    .pdf-embed-wrapper iframe {
        height: 500px;
    }
    
    .btn-download-large {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* ==========================================
   JANNAH THEME COMPATIBILITY
   ========================================== */

/* Match Jannah's container width if using their container class */
.pdf-ebooks-archive-wrapper .container,
.pdf-ebook-single-wrapper .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Ensure compatibility with Jannah's font family */
.pdf-ebooks-archive-wrapper,
.pdf-ebook-single-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Match Jannah's link colors if needed */
.pdf-ebooks-archive-wrapper a,
.pdf-ebook-single-wrapper a {
    transition: all 0.3s ease;
}

/* Override any conflicting Jannah styles for better display */
.pdf-ebook-item,
.pdf-ebook-single {
    margin: 0;
}

.pdf-ebook-item img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Loading State for PDF */
.pdf-embed-wrapper.loading {
    position: relative;
    min-height: 800px;
}

.pdf-embed-wrapper.loading::before {
    content: "Loading PDF...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 18px;
}

/* ==========================================
   SINGLE PAGE STYLES - NEW DESIGN
   ========================================== */

/* Site Content Layout */
.site-content {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#primary {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Breadcrumbs */
#breadcrumb {
    margin-bottom: 20px;
    padding: 15px 0;
    font-size: 14px;
    line-height: 1.4;
}

#breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

#breadcrumb a:hover {
    color: #007cba;
}

#breadcrumb .tie-icon-home {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 5px;
    vertical-align: middle;
}

#breadcrumb .tie-icon-home:before {
    content: "🏠";
    font-size: 14px;
}

#breadcrumb .delimiter {
    margin: 0 8px;
    color: #ccc;
    font-style: normal;
}

#breadcrumb .current {
    color: #333;
    font-weight: 600;
}

/* Responsive Breadcrumbs */
@media (max-width: 768px) {
    #breadcrumb {
        margin-bottom: 15px;
        padding: 10px 0;
        font-size: 13px;
    }
    
    #breadcrumb .delimiter {
        margin: 0 6px;
    }
}

@media (max-width: 480px) {
    #breadcrumb {
        font-size: 12px;
    }
    
    #breadcrumb .delimiter {
        margin: 0 4px;
    }
}

/* Ebook Header */
.ebook-header {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}


.ebook-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.ebook-author {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.author-label {
    color: #666;
    font-weight: 500;
}

.author-name {
    color: #333;
    font-weight: 600;
    margin-left: 8px;
}

.ebook-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ebook-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.9rem;
}

.ebook-meta svg {
    width: 16px;
    height: 16px;
    color: #888;
}

.ebook-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download, .btn-fullscreen {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download:hover, .btn-fullscreen:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.btn-fullscreen {
    background: #28a745;
}

.btn-fullscreen:hover {
    background: #1e7e34;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

/* PDF Viewer Section */
.pdf-viewer-section {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.pdf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.pdf-viewer-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-control:hover {
    background: #f8f9fa;
    border-color: #007cba;
}

.zoom-level {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pdf-embed-container {
    position: relative;
    background: #f5f5f5;
    min-height: 600px;
    transition: all 0.3s ease;
}

.pdf-embed-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
}

#pdfViewer {
    width: 100%;
    border: none;
    display: block;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.pdf-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    background: #f8f9fa;
}

.pdf-fallback-content {
    text-align: center;
    padding: 40px;
}

.pdf-fallback-content svg {
    color: #ccc;
    margin-bottom: 20px;
}

.pdf-fallback-content h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.pdf-fallback-content p {
    color: #888;
    margin-bottom: 20px;
}

.btn-download-fallback {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-download-fallback:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.no-pdf-message {
    text-align: center;
    padding: 60px 30px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-pdf-message svg {
    color: #ccc;
    margin-bottom: 20px;
}

.no-pdf-message h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.no-pdf-message p {
    color: #888;
    margin: 0;
}

/* Ebook Description */
.ebook-description {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ebook-description h3 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.description-content {
    line-height: 1.7;
    color: #555;
}

.description-content p {
    margin-bottom: 15px;
}

/* Navigation */
.ebook-navigation {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-previous, .nav-next {
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.next-link {
    flex-direction: row-reverse;
    text-align: right;
}

.nav-content {
    flex: 1;
}

.nav-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.nav-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .ebook-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ebook-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .site-content {
        padding: 10px;
    }
    
    .ebook-header {
        padding: 20px;
    }
    
    .ebook-title {
        font-size: 1.8rem;
    }
    
    .ebook-actions {
        justify-content: center;
    }
    
    .pdf-viewer-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .pdf-controls {
        justify-content: center;
    }
    
    .ebook-navigation {
        flex-direction: column;
    }
    
    .nav-link {
        text-align: center;
    }
    
    .next-link {
        flex-direction: row;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .ebook-title {
        font-size: 1.5rem;
    }
    
    .btn-download, .btn-fullscreen {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .pdf-embed-container {
        min-height: 400px;
    }
    
    #pdfViewer {
        height: 400px !important;
    }
}

/* Print Styles */
@media print {
    .ebook-actions,
    .pdf-controls,
    .ebook-navigation {
        display: none;
    }
    
    .pdf-viewer-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .ebook-header,
    .ebook-description {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

article {
    background-color: transparent;
}