/**
 * PDF Viewer Plugin Styles
 * Version: 1.0.0
 */

/* ===========================
   Single PDF Viewer
   =========================== */

.pdf-viewer-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pdf-viewer-header {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.pdf-viewer-header .pdf-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.pdf-viewer-header .pdf-description {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.pdf-embed-wrapper {
    position: relative;
    width: 100%;
    background: #e9ecef;
}

.pdf-iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    display: block;
}

.pdf-actions {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.pdf-download-btn,
.pdf-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #d63638;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pdf-download-btn:hover,
.pdf-view-btn:hover {
    background: #b02327;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 54, 56, 0.3);
}

.pdf-download-btn .dashicons,
.pdf-view-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ===========================
   PDF Gallery
   =========================== */

.pdf-gallery-container {
    margin: 30px 0;
}

.pdf-gallery-grid {
    display: grid;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.pdf-gallery-columns-1 {
    grid-template-columns: 1fr;
}

.pdf-gallery-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.pdf-gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.pdf-gallery-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.pdf-gallery-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.pdf-gallery-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.pdf-gallery-item {
    list-style: none;
}

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

.pdf-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.pdf-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #f8f9fa;
    overflow: hidden;
}

.pdf-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pdf-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.9);
}

.pdf-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pdf-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.pdf-card-excerpt {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.pdf-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.pdf-card-actions .pdf-view-btn,
.pdf-card-actions .pdf-download-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    justify-content: center;
    text-align: center;
}

.pdf-card-actions .pdf-view-btn {
    background: #2271b1;
}

.pdf-card-actions .pdf-view-btn:hover {
    background: #135e96;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* ===========================
   Responsive Design
   =========================== */

@media screen and (max-width: 1024px) {
    .pdf-gallery-columns-5,
    .pdf-gallery-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .pdf-gallery-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .pdf-viewer-header {
        padding: 15px 20px;
    }

    .pdf-viewer-header .pdf-title {
        font-size: 20px;
    }

    .pdf-actions {
        padding: 15px 20px;
    }

    .pdf-gallery-columns-3,
    .pdf-gallery-columns-4,
    .pdf-gallery-columns-5,
    .pdf-gallery-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .pdf-gallery-grid {
        gap: 16px;
    }

    .pdf-iframe {
        min-height: 400px;
    }
}

@media screen and (max-width: 480px) {
    .pdf-viewer-header {
        padding: 12px 15px;
    }

    .pdf-viewer-header .pdf-title {
        font-size: 18px;
    }

    .pdf-actions {
        padding: 12px 15px;
    }

    .pdf-gallery-columns-2,
    .pdf-gallery-columns-3,
    .pdf-gallery-columns-4,
    .pdf-gallery-columns-5,
    .pdf-gallery-columns-6 {
        grid-template-columns: 1fr;
    }

    .pdf-card-content {
        padding: 15px;
    }

    .pdf-card-title {
        font-size: 16px;
    }

    .pdf-card-actions {
        flex-direction: column;
    }

    .pdf-download-btn,
    .pdf-view-btn {
        width: 100%;
        justify-content: center;
    }

    .pdf-iframe {
        min-height: 300px;
    }
}

/* ===========================
   Loading State
   =========================== */

.pdf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.pdf-loading::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #d63638;
    border-radius: 50%;
    animation: pdf-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes pdf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================
   Error State
   =========================== */

.pdf-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 4px;
    color: #dc2626;
    text-align: center;
}

/* ===========================
   Admin Styles
   =========================== */

.pdf-upload-container .dashicons {
    vertical-align: middle;
}

.pdf-file-info a {
    text-decoration: none;
    color: #2271b1;
}

.pdf-file-info a:hover {
    color: #135e96;
    text-decoration: underline;
}
