/* ==========================================================================
   VideoProduct - Multi-Video Playlist & Light Theme Stylesheet
   ========================================================================== */

:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Premium Light Theme Palette */
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-border: #e2e8f0;

    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-dark: #0f172a;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --success-green: #16a34a;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Main Layout Structure */
.app-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Mini Action Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.top-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.main-video-wrapper {
    width: 100%;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Playlist Selector Header */
.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.playlist-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.playlist-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    background: #e0e7ff;
    color: var(--accent-indigo);
    border-radius: 20px;
}

/* Multi-Video Playlist Grid (Side-by-Side 2 Columns, No Scroll, All Visible) */
.video-playlist-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-card-border);
}

.video-tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--text-secondary);
    border: 1px solid var(--bg-card-border);
    cursor: pointer;
    text-align: left;
    white-space: normal;
    line-height: 1.25;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.video-tab.grid-col-full {
    grid-column: span 2;
}

.video-tab i {
    font-size: 13px;
    flex-shrink: 0;
}

.video-tab span {
    flex: 1;
    word-break: normal;
}

.video-tab:hover {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: #94a3b8;
}

.video-tab.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@media (min-width: 640px) {
    .video-playlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .video-tab.grid-col-full {
        grid-column: span 1;
    }
}

@media (min-width: 860px) {
    .video-playlist-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.video-card-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    word-break: break-word;
}

.video-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.unmute-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.pulse-btn {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
    70% { box-shadow: 0 0 0 16px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.video-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--bg-card-border);
}

.status-indicator {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius-xl);
}

.btn-full {
    width: 100%;
}

/* Modal Popup Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal-btn {
    background: #f1f5f9;
    border: 1px solid var(--bg-card-border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.qr-code-frame {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    border: 1px solid var(--bg-card-border);
    display: flex;
    justify-content: center;
    align-items: center;
}

#qr-modal-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.url-badge {
    font-size: 11px;
    font-family: monospace;
    color: var(--accent-blue);
    background: #eff6ff;
    border: 1px dashed #bfdbfe;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    word-break: break-all;
    max-width: 100%;
}

.text-accent { color: var(--accent-blue); }
.text-success { color: var(--success-green); }
.hidden { display: none !important; }

@media (max-width: 600px) {
    .app-container {
        padding: 16px 12px;
    }
    .video-card {
        padding: 16px;
    }
    .video-title {
        font-size: 18px;
    }
    .video-tab {
        padding: 12px 14px;
        font-size: 13px;
    }
}
