/* ============================================================
   Discovr Now Studios — style.css (v1.1.0)
   Premium dark theme with glassmorphism
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --bg-color: #0a0a0c;
    --bg-surface: rgba(255, 255, 255, 0.02);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    --bg-surface-alt: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.10);
    --text-color: #f8f9fa;
    --text-muted: #86868b;
    --text-secondary: #a1a1aa;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --green: #22c55e;
    --green-muted: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-muted: rgba(239, 68, 68, 0.15);
    --amber: #f59e0b;
    --amber-muted: rgba(245, 158, 11, 0.15);
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- App Container --- */
#app {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 2rem;
}

/* ============================================================
   HOME VIEW
   ============================================================ */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1.2s var(--transition-smooth) forwards;
}

.logo-main {
    max-width: 320px;
    width: 85%;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.04));
    transition: transform 0.6s var(--transition-smooth);
    user-select: none;
    -webkit-user-drag: none;
}

.logo-main:hover {
    transform: scale(1.02);
}

/* ============================================================
   CLIENT DELIVERY VIEW
   ============================================================ */

/* -- Header -- */
.delivery-wrapper {
    width: 100%;
    max-width: 960px;
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

.delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.delivery-header .logo-link {
    display: inline-flex;
    transition: opacity 0.3s;
}

.delivery-header .logo-link:hover {
    opacity: 0.8;
}

.delivery-header .client-logo {
    max-width: 140px;
    height: auto;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-back:hover {
    color: var(--text-color);
    border-color: var(--border-medium);
    background: var(--bg-surface);
}

/* -- Welcome Section -- */
.delivery-welcome {
    text-align: center;
    margin: 2.5rem 0 2rem;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.1s both;
}

.delivery-welcome h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.delivery-note {
    max-width: 600px;
    margin: 1rem auto 0;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.2s both;
}

/* -- Media Sections -- */
.media-section {
    margin: 2.5rem 0;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.3s both;
}

.media-section + .media-section {
    animation-delay: 0.4s;
}

.media-section-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.media-section-title .icon {
    font-size: 1.2rem;
}

/* -- Video Grid & Player -- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.video-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.video-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.video-card.active {
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.video-card-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.video-card-icon {
    font-size: 1.3rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.video-player-wrapper {
    margin-top: 1.25rem;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-subtle);
    animation: fadeIn 0.5s var(--transition-smooth) forwards;
}

.video-player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* -- Audio Grid -- */
.audio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.audio-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s, border-color 0.2s;
}

.audio-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
}

.audio-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.audio-card-info {
    flex: 1;
    min-width: 0;
}

.audio-card-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.audio-card audio {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    outline: none;
}

/* -- Photo Grid -- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.photo-card {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: transform 0.3s var(--transition-smooth), border-color 0.2s;
    position: relative;
    background: linear-gradient(90deg, rgba(255,255,255,0.01) 25%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.01) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.photo-card:hover {
    transform: scale(1.03);
    border-color: var(--border-medium);
}

.photo-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.photo-thumbnail.loaded {
    opacity: 1;
}

.photo-card:hover .photo-thumbnail.loaded {
    opacity: 0.85;
}

/* -- Lightbox -- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease forwards;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10003;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* -- Brand Logo Naming & Grouping -- */
.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-separator {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

.client-custom-logo {
    max-height: 38px;
    max-width: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.03));
}

/* -- Actions & Buttons -- */
.delivery-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 2.5rem;
    animation: fadeInUp 0.8s var(--transition-smooth) 0.2s both;
}

.btn-download-all {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-download-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-download-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-download-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    opacity: 1;
}

.btn-download-all:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.12);
}

.btn-download-all:active {
    transform: translateY(0);
}

/* -- Media List triggers -- */
.video-trigger, .audio-trigger {
    cursor: pointer;
}

/* -- Lightbox Upgrades for iframe preview -- */
.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: 10002;
}

.lightbox-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.lightbox-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-hover);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.lightbox-filename {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
}

.lightbox-iframe-wrapper {
    width: 85vw;
    height: 70vh;
    max-width: 1100px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.lightbox-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* -- Delivery CTA Footer -- */
.delivery-footer {
    margin-top: 5rem;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--border-subtle);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delivery-footer a {
    color: var(--accent-hover);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    margin-left: 0.25rem;
}

.delivery-footer a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.14);
}

.lightbox-nav.prev { left: 1.5rem; }
.lightbox-nav.next { right: 1.5rem; }

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* -- Download Button -- */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.download-btn:hover {
    color: var(--text-color);
    border-color: var(--border-medium);
    background: var(--bg-surface);
}

/* -- Loading Spinner -- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    animation: fadeIn 0.5s var(--transition-smooth) forwards;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ============================================================
   ERROR / 404 VIEW
   ============================================================ */
.error-container {
    text-align: center;
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

.error-title {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

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

/* -- Shared Buttons -- */
.btn-primary {
    display: inline-block;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Legacy client-container kept for backwards compat */
.client-container {
    width: 100%;
    max-width: 680px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.client-header {
    margin-bottom: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.client-logo {
    max-width: 160px;
    height: auto;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.client-logo:hover {
    opacity: 1;
}

.client-title {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-top: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.client-info-box {
    background: var(--bg-surface-alt);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 3px solid var(--accent-color);
    width: 100%;
    text-align: left;
}

.client-info-box h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--accent-hover);
}

.client-info-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* -- Category Separators & Titles -- */
.media-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    margin: 3rem 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.media-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* -- Premium Preloader -- */
#preloader {
    position: fixed;
    inset: 0;
    background: #0a0a0c;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    opacity: 1;
    visibility: visible;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.preloader-logo-wrap {
    animation: preloaderPulse 2.5s infinite ease-in-out;
}

.preloader-logo {
    max-width: 180px;
    height: auto;
    display: block;
}

.preloader-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.02));
    }
    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.08));
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .delivery-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .delivery-welcome h1 {
        font-size: 1.75rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .lightbox-nav.prev { left: 0.5rem; }
    .lightbox-nav.next { right: 0.5rem; }
}
