/* ========================================
   nexUS Observatories - Archive Page Styles
   Enhanced with file list and player layout + WebM optimization
   ======================================== */

/* Archive-specific enhancements */
.archive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.archive-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.3));
}

.archive-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 300;
}

/* Two-Column Layout */
.archive-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin: 3rem 0;
    animation: fadeIn 1s ease-out 0.3s both;
    min-height: 600px;
}

/* File List Section (Left Column) */
.file-list-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.file-list-header {
    padding: 1.5rem;
    background: rgba(16, 42, 76, 0.4);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

.file-count {
    background: var(--primary-color);
    color: var(--dark-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-display);
}

.file-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

/* FIXED: Loading Spinner - Issue #98 */
.loading-spinner {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 1.5rem; /* Reduced from default large size */
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.8;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    font-size: 0.9rem;
    margin: 0;
    font-family: var(--font-display);
    font-weight: 300;
}

/* File List Items */
.file-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item:hover {
    background: rgba(79, 172, 254, 0.1);
    border-left: 3px solid var(--primary-color);
}

.file-item.active {
    background: rgba(79, 172, 254, 0.2);
    border-left: 3px solid var(--primary-color);
}

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

.file-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.file-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
    flex: 1;
}

/* FIXED: WEBM Format Bar - Issue #98 */
.file-format {
    background: linear-gradient(to right, var(--secondary-color), #00ff88);
    color: var(--dark-bg);
    padding: 0.2rem 0.4rem; /* Reduced horizontal padding */
    border-radius: 6px; /* Slightly smaller radius */
    font-size: 0.65rem; /* Slightly smaller font */
    font-weight: 600;
    font-family: var(--font-display);
    text-transform: uppercase;
    max-width: 50px; /* Add width constraint */
    min-width: 45px; /* Prevent it from getting too small */
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking in flex layout */
    align-self: flex-start; /* Align to top */
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.file-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-detail i {
    width: 12px;
    font-size: 0.75rem;
    color: var(--primary-color);
    opacity: 0.7;
}

/* Player Section (Right Column) */
.player-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.player-header {
    padding: 1.5rem;
    background: rgba(16, 42, 76, 0.4);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

.player-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: rgba(79, 172, 254, 0.2);
    border-color: var(--primary-color);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.player-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
    min-height: 300px;
}

.player-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.player-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.player-container video {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.8);
}

/* Error and No Videos States */
.error-message, .no-videos {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.error-message i, .no-videos i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.error-message h3, .no-videos h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.error-message p, .no-videos p {
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.error-actions {
    margin-top: 1rem;
}

/* Archive Responsive Design */
@media (max-width: 1024px) {
    .archive-content {
        grid-template-columns: 350px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .archive-container {
        padding: 1rem;
    }
    
    .archive-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .file-list-section {
        order: 2;
    }
    
    .player-section {
        order: 1;
    }
    
    .archive-header h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .file-list-container {
        max-height: 300px;
    }

    .file-main-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .file-format {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .archive-container {
        padding: 0.5rem;
    }
    
    .archive-header {
        margin-bottom: 2rem;
    }
    
    .archive-header h1 {
        font-size: 1.8rem;
    }
    
    .player-header,
    .file-list-header {
        padding: 1rem;
    }
    
    .file-item {
        padding: 0.8rem 1rem;
    }
    
    .file-name {
        font-size: 0.85rem;
    }

    .loading-spinner {
        padding: 2rem 1rem;
    }
}

/* Page Header and Navigation for Archive */
.page-header {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.page-header .logo-link {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 1rem;
}

.page-header .logo-main {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.3));
}

.page-header .logo-emphasis {
    background: linear-gradient(to right, var(--secondary-color), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    filter: drop-shadow(0 0 25px rgba(0, 242, 254, 0.5));
}

.page-header .logo-sub {
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.page-header .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.page-header .breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-header .breadcrumb a:hover {
    color: var(--secondary-color);
}

/* Navigation styles */
.nav-back {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    background: rgba(16, 42, 76, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-back:hover {
    background: rgba(24, 58, 102, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

@media (max-width: 768px) {
    .nav-back {
        top: 1rem;
        left: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
}
