/* Archive Documents Manager - Frontend Styles */

/* Document List Styles */
.archive-documents-list {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
    grid-template-columns: auto auto auto;
}
@media only screen and (max-width: 1062px) {
    .archive-documents-list {
        grid-template-columns: auto auto;
    }
}

@media only screen and (max-width: 767px) {
    .archive-documents-list {
        grid-template-columns: auto;
    }
}

.archive-document-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #fbbf24 !important;
    border-radius: 8px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.archive-document-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
    border: 1px solid var(--enfold-header-color-border) !important;
}

.archive-document-item.featured {
    border-color: #3b82f6;
    background: #eff6ff;
}

.archive-document-item.featured::before {
    content: "Featured";
    position: absolute;
    top: -10px;
    left: 20px;
    background: #3b82f6;
    color: white;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.archive-document-item {
    position: relative;
    cursor: pointer;
}

/* Document Icon */
.document-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
}

.document-icon .file-ext {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
}

/* Different colors for different file types */
.document-icon .file-ext {
    padding: 4px 8px;
    border-radius: 4px;
}

/* PDF - Red */
.archive-document-item:has(.file-ext:contains("PDF")) .document-icon {
    background: #fee2e2;
    border-color: #fecaca;
}

.archive-document-item:has(.file-ext:contains("PDF")) .file-ext {
    color: #991b1b;
}

/* Document Content */
.document-content {
    flex: 1;
    min-width: 0;
}

.document-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.document-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

.document-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
}

.archive-document-item:hover .document-title a {
    color: #3b82f6;
}

.archive-document-item .download-link {
    position: relative;
    z-index: 1;
}

.document-excerpt {
    margin: 0 0 1rem 0;
    color: #6b7280;
    line-height: 1.6;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.document-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.document-meta span::before {
    content: "•";
    margin-right: 0.25rem;
}

.document-meta span:first-child::before {
    display: none;
}

.download-link {
    display: inline-flex;
    align-items: center;
    background: #fbbf24;
    color: #4b2f0b !important;
    text-decoration: none;
    font-weight: 500;
    margin-left: auto;
    border-color: #ffca13;
    border-style: none;
    border-radius: 0 0 0 0;
    transition: all 0.4s ease-in-out;
    padding: 10px 10px 5px 15px;
    font-family: 'bushcraft', Helvetica, Arial, sans-serif;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2em;
}

.download-link:hover {
    background: #4b2f0b;
    color: #fbbf24 !important;
}

.download-link::after {
    content: "↓";
    margin-left: 0.5rem;
}

/* ============================================
   Single Document Page Styles
   ============================================ */

/* Single column layout */
.archive-doc-single {
    margin: 0 auto;
    padding: 2rem;
}

/* PDF Viewer */
.pdf-viewer-container {
    margin: 2rem 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.pdf-viewer-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.25rem;
}

.pdf-embed-wrapper {
    position: relative;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

/* Document Actions */
.document-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn-download,
.btn-preview {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: #fbbf24;
    color: #4b2f0b !important;
    font-weight: 500;
    border-color: #ffca13;
    border-style: none;
    border-radius: 0 0 0 0;
    transition: all 0.4s ease-in-out;
    padding: 10px 10px 5px 15px;
    font-family: 'bushcraft', Helvetica, Arial, sans-serif;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.2em;
}

.btn-download {
    background: #fbbf24;
    color: #4b2f0b;
}

.btn-download:hover {
    background: #4b2f0b;
    color: #fbbf24 !important;
}

.btn-preview {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-preview:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Document Info */
.document-file-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid var(--enfold-header-color-border);
}

.document-file-info h3 {
    margin-top: 0;
    color: #1f2937;
}

.file-details {
    margin: 1rem 0;
}

.file-detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.file-detail-row:last-child {
    border-bottom: none;
}

.file-detail-label {
    font-weight: 600;
    color: #6b7280;
    width: 120px;
}

.file-detail-value {
    color: #1f2937;
}

/* Taxonomies */
.document-taxonomies {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.taxonomy-group {
    margin-bottom: 1rem;
}

.taxonomy-group:last-child {
    margin-bottom: 0;
}

.taxonomy-label {
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 0.5rem;
}

.taxonomy-terms {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.taxonomy-term {
    background: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.taxonomy-term:hover {
    background: #fbbf24;
    color: #4b2f0b !important;
    border-color: #fbbf24;
}

/* Featured Badge */
.featured-badge {
    background: #fbbf24;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Entry Meta */
.archive-doc-single .entry-meta {
    color: #6b7280;
    margin: 1rem 0 2rem;
    font-size: 0.875rem;
}

.archive-doc-single .entry-meta span {
    margin-right: 1rem;
}

/* PDF Embedder Note */
.pdf-embedder-note {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.pdf-embedder-note strong {
    color: #92400e;
}

.pdf-embedder-note a {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Image Display */
.image-display {
    margin: 2rem 0;
    text-align: center;
}

.image-display img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Audio Player */
.audio-player-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.audio-player-container h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #1f2937;
}

.audio-player-container .wp-audio-shortcode {
    width: 100% !important;
}

/* Video Embed */
.video-embed-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.video-embed-container h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #1f2937;
}

.video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* PDF Embed (legacy) */
.pdf-embed {
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

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

/* ============================================
   Archive Template Styles
   ============================================ */

.archive-filters {
    margin: 1.5rem 0;
}

.archive-search-input {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.archive-search-btn {
    padding: 0.5rem 1rem;
    background: #fbbf24;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.archive-search-btn:hover {
    background: #2563eb;
}

/* ============================================
   Year Filter Styles
   ============================================ */

.archive-docs-filters {
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.filter-header {
    padding: 1rem;
    background: #f9fafb;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-header-label {
    color: #1f2937;
    font-weight: bold;
}

.filter-selected-count {
    background: #fbbf24;
    color: #4b2f0b;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-toggle-icon {
    color: #6b7280;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.year-filter-panel {
    display: none;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.year-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.year-checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.year-checkbox-label:hover {
    background: #f3f4f6;
}

.year-checkbox-label.checked {
    background: #eff6ff;
    border-color: #fbbf24;
}

.year-checkbox-label.checked:hover {
    background: #dbeafe;
}

.year-checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

.year-checkbox-name {
    font-size: 0.875rem;
    color: #1f2937;
}

.year-checkbox-label.checked .year-checkbox-name {
    font-weight: 600;
}

.year-checkbox-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #6b7280;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.filter-btn-apply {
    padding: 10px 10px 5px 15px;
    background: #ffca13;
    color: #4b2f0b;
    border: none;
    border-radius: 0px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s ease-in-out;
    font-family: 'bushcraft', Helvetica, Arial, sans-serif;
}

.filter-btn-apply:hover {
    background: #4b2f0b;
    color: #ffca13;
}

.filter-btn-clear,
.filter-btn-close {
    padding: 0.625rem 1.25rem;
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn-clear:hover,
.filter-btn-close:hover {
    background: #f9fafb;
}

.filter-btn-close {
    margin-left: auto;
}

/* ============================================
   Pagination Styles
   ============================================ */

.archive-docs-pagination {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 0.75rem;
    background: #fff;
    color: #4b2f0b !important;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-decoration: none;
    min-width: 40px;
    text-align: center;
    font-family: 'bushcraft', Helvetica, Arial, sans-serif;
}

.page-link:not(.current):hover {
    border-color: #ffca13;
}

.page-link.current {
    background: #ffca13;
    color: #4b2f0b;

}

.page-link.prev,
.page-link.next {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: #6b7280;
}

.pagination-info {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Login Notice */
.archive-docs-login-notice {
    background: #f0f9ff;
    border-left: 4px solid #fbbf24;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.archive-docs-login-notice p {
    margin: 0;
}

.archive-docs-login-notice a {
    color: #fbbf24;
    text-decoration: underline;
}

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

@media (max-width: 768px) {
    .archive-document-item {
        flex-direction: column;
    }

    .document-icon {
        width: 50px;
        height: 50px;
    }

    .document-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-link {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .document-actions {
        flex-direction: column;
    }

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

    .pdf-embed-wrapper iframe {
        min-height: 600px;
    }
}

/* Admin Column Badges */
.file-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
