/* ========================================
   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;
}

/* New 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;
}

/* 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: 1rem;
}

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

.file-format {
    background: linear-gradient(to right, var(--secondary-color), #00ff88);
    color: var(--dark-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-display);
    text-transform: uppercase;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.file-detail {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.file-detail i {
    color: var(--primary-color);
    font-size: 0.7rem;
}

.file-size {
    font-weight: 500;
}

/* 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-placeholder h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.player-placeholder p {
    font-size: 1rem;
    color: var(--text-muted);
}

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

/* Video Info Panel */
.video-info {
    padding: 1.5rem;
    background: rgba(16, 42, 76, 0.3);
    border-top: 1px solid var(--card-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* Loading state */
.loading-spinner {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease-out;
}

.loading-spinner .fa-spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading-spinner p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* No videos state */
.no-videos {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

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

.no-videos h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-videos p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Error state */
.error-message {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #ff4444;
}

.error-message h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-message p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Archive footer styles */
.archive-footer {
    margin-top: 4rem;
    text-align: center;
}

.archive-footer .info-card {
    margin-bottom: 2rem;
    text-align: left;
}

.archive-footer h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.archive-footer h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.archive-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(16, 42, 76, 0.3);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    min-width: 20px;
}

.stat-item strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.format-info,
.contact-archive {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

.format-info p,
.contact-archive p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-archive a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-archive a:hover {
    color: var(--secondary-color);
}

.return-home {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

/* Browser warning */
.browser-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-left: 4px solid #ffc107;
    animation: fadeIn 0.5s ease-out;
}

.browser-warning.hidden {
    display: none;
}

.browser-warning i {
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 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;
    }
    
    .video-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .file-list-container {
        max-height: 300px;
    }
    
    .archive-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .archive-container {
        padding: 0.5rem;
    }
    
    .archive-header {
        margin-bottom: 2rem;
    }
    
    .archive-header h1 {
        font-size: 1.8rem;
    }
    
    .archive-header p {
        font-size: 1rem;
    }
    
    .player-header,
    .file-list-header {
        padding: 1rem;
    }
    
    .player-header h2,
    .file-list-header h2 {
        font-size: 1rem;
    }
    
    .file-item {
        padding: 0.8rem 1rem;
    }
    
    .file-name {
        font-size: 0.85rem;
    }
    
    .file-details {
        font-size: 0.75rem;
    }
    
    .video-info {
        padding: 1rem;
    }
    
    .info-row {
        font-size: 0.8rem;
    }
    
    .archive-footer .info-card {
        padding: 1rem;
    }
    
    .format-info,
    .contact-archive {
        padding: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .file-list-section,
    .player-section {
        border-width: 2px;
    }
    
    .control-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .archive-header,
    .archive-content,
    .loading-spinner {
        animation: none;
    }
    
    .file-item:hover,
    .control-btn:hover {
        transform: none;
    }
}

/* Scrollbar styling for file list */
.file-list-container::-webkit-scrollbar {
    width: 6px;
}

.file-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.file-list-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.file-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Focus states for accessibility */
.file-item:focus,
.control-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Download button special styling */
.control-btn.download-active {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
}

.control-btn.download-active:hover {
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}