section.archive-banner{
    margin-bottom: 40px;
}
/* --- Header --- */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.category-title {
    font-size: 32px;
    font-weight: 500;
    margin: 0;
}
.back-button {
    font-weight: 600;
    text-decoration: none;
    color: var(--deepBlue);;
}

/* --- Main Grid --- */
.file-browser-grid {
    display: grid;
    grid-template-columns: 320px 1fr; /* Fixed sidebar, flexible content */
    gap: 40px;
    border-top: 1px solid #dee2e6;
    padding-top: 30px;
}

/* --- Left Column: File List --- */
.file-list-column {
    border-right: 1px solid #dee2e6;
    padding-right: 30px;
}
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.2s ease;
}
.file-list-item:hover, .file-list-item.active {
    background-color: #f8f9fa;
    border-radius: 6px;
}
.file-type-icon {
    width: 26px;
}
.file-name {
    font-weight: 500;
}

.active .file-name{
    font-weight: 700;
}

/* --- Right Column: Preview Pane --- */
.preview-default-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #868e96;
    height: 100%;
    min-height: 400px;
}
.preview-default-state img {
    width: 60px;
    margin-bottom: 20px;
}

/* Styles for when content is loaded */
.preview-embed iframe, .preview-embed img {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    aspect-ratio: 16 / 9; /* Ensures a consistent shape */
    object-fit: contain; /* Good for images and documents */
}

.preview-embed img{
    aspect-ratio: unset;
    object-fit: unset;
}
.preview-embed .wp-embedded-content { /* YouTube/Vimeo wrapper */
    aspect-ratio: 16 / 9;
}
.preview-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}
.preview-description p {
    margin-top: 0;
    font-size: 12px;
}
.preview-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.action-button {
    /* Style your buttons here */
}

.preview-container{
    display: flex;
    justify-content: space-between;
}

.preview-container > .preview-embed{
    width: 65%;
}

.preview-container > .preview-details{
    width: 35%;
    padding-left: 25px;
}

/* --- Preview Pane Action Buttons --- */
.preview-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between buttons */
    margin-top: 25px;
}

.preview-actions .action-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dee2e6;
    background-color: #ffffff;
    border-radius: 50%; /* This makes the button circular */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.preview-actions .action-button:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-actions .action-button img {
    width: 100%;
}

/* Target the container that WordPress creates */
.preview-embed .wp-video {
    width: 100% !important; /* Override the inline style="width: 640px;" */
    max-width: 100%;
}

/* Target the actual <video> element */
.preview-embed .wp-video-shortcode {
    width: 100% !important;
    height: auto !important; /* Let the height adjust automatically to maintain the aspect ratio */
}
/* 
  By default, this hides the "Download" and "Email" text,
  showing only the icons as per your screenshot.
  Remove this block if you want to show the text next to the icons.
*/
.preview-actions .action-button span {
    display: none;
}

/* --- Loading Overlay & Fade Animation --- */

/* 1. The wrapper needs to be a positioning context */
.file-browser-wrapper {
    position: relative;
}

/* 2. Style the overlay mask */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* The "white mask" effect */
    background-color: rgba(255, 255, 255, 0.85); 
    
    /* Center the spinner inside */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Hide it by default and set up the fade transition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 10;
}

/* 3. A class to make the overlay visible */
.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* 4. Update the spinner to be centered by the overlay */
.loading-spinner {
    display: block;
    width: 50px;
    height: 50px;
    
    /* We no longer need margins for positioning */
    margin: 0; 

    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db; 
    border-radius: 50%;
    
    animation: spin 1s linear infinite;
}

/* Make sure the keyframes animation is still present */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Preloader Animation --- */

/* 1. Define the spinning animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* 2. Style the spinner element created by the JavaScript */
  .loading-spinner {
    display: block;
    width: 50px;
    height: 50px;
    margin: 150px auto; /* Adds space from the top and centers it horizontally */
  
    border: 5px solid #f3f3f3; /* Light grey circle */
    border-top: 5px solid #3498db; /* Blue color for the spinning part */
    border-radius: 50%; /* Makes it a circle */
    
    animation: spin 1s linear infinite; /* Applies the animation */
  }
  
  /* 3. For the mobile view, make the spinner a bit smaller */
  .mobile-preview-container .loading-spinner {
      width: 40px;
      height: 40px;
      margin: 40px auto; /* Less top margin for mobile */
  }

/* --- Mobile View & Mobile Preview --- */
.mobile-preview-container {
    display: none; /* Hidden by default */
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f5;
}
@media (max-width: 768px) {
    /* Stack the columns */
    .file-browser-grid {
        grid-template-columns: 1fr;
    }
    .file-list-column {
        border-right: none;
        padding-right: 0;
    }
    /* Hide the desktop preview pane */
    #file-preview-pane {
        display: none;
    }
    .category-title {
        font-size: 1.5rem;
    }
}

