/*
Theme Name: U13 T2 Bears Video Portal 2026
Description: Video portal for U13T2Bears.ca with separate parent and coach access. Parents get a plain YouTube embed; coaches get a bookmark-driven analyzer with a zoomable bookmark bar.
Version: 1.0
Author: Custom Development
Text Domain: bears-2026
*/

/* ==========================================================================
   Design tokens

   The 2025 theme scattered ~20 color literals through this file, which let two
   different reds drift apart: a Tailwind-stock family (#dc2626 red-600,
   #991b1b red-800, #ef4444 red-500, #fecaca red-200) left over from
   scaffolding, and rgb(192, 28, 55), which was sampled from the Bears logo.
   The logo red is the real brand color and is the only one used here.
   ========================================================================== */

:root {
    --bears-red: rgb(192, 28, 55);
    --bears-red-dark: rgb(170, 25, 49);
    --bears-red-ring: rgba(192, 28, 55, 0.15);
    --bears-red-shadow: rgba(192, 28, 55, 0.35);
    /* Pale tint, 25% red on white. Replaces the #fecaca site-title hover. */
    --bears-red-tint: rgb(239, 198, 205);

    --bears-black: #000000;

    --text-body: #333333;
    --text-heading: #1f2937;
    --text-muted: #6b7280;
    --text-label: #374151;
    --text-date: #9ca3af;

    --border-input: #e5e7eb;
    --border-card: #f3f4f6;

    --surface: #ffffff;
    --page-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);

    --font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --radius-card: 15px;
    --radius-control: 8px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.1);

    --container: 1200px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   Reset and base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    line-height: 1.6;
    color: var(--text-body);
    background: var(--page-bg);
    min-height: 100vh;
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
    background: var(--bears-black);
    color: #ffffff;
    padding: 1rem 0;
    box-shadow: var(--shadow-header);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-title:hover {
    color: var(--bears-red-tint);
}

.site-logo {
    height: 48px;
    width: auto;
    display: block;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-control);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.current {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bears-red);
    color: #ffffff;
}

.role-badge.role-parent {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2rem;
}

.site-main.is-wide {
    max-width: 1600px;
}

.site-footer {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-weight: 700;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Gallery controls
   ========================================================================== */

.video-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input,
.filter-select,
.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-input);
    border-radius: var(--radius-control);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text-body);
}

.search-input:focus,
.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--bears-red);
    box-shadow: 0 0 0 3px var(--bears-red-ring);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-weight: 500;
    color: var(--text-label);
}

/* ==========================================================================
   Video grid and cards
   ========================================================================== */

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid var(--border-card);
    text-decoration: none;
    color: inherit;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--bears-red);
    text-decoration: none;
    color: inherit;
}

.video-card:visited {
    color: inherit;
    text-decoration: none;
}

.video-card.is-hidden {
    display: none;
}

.video-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.4;
}

.video-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-input);
    font-size: 0.9rem;
}

.video-date {
    color: var(--text-date);
}

.video-category {
    background: var(--bears-red);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.bookmark-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--border-card);
    color: var(--text-label);
    border: 1px solid var(--border-input);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.no-videos {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* ==========================================================================
   Buttons and notices
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bears-red);
    color: #ffffff;
    text-decoration: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-control);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--bears-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--bears-red-shadow);
    color: #ffffff;
}

.btn.secondary {
    background: var(--text-muted);
}

.btn.secondary:hover {
    background: #4b5563;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bears-red);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-control);
    font-weight: 500;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bears-red-dark);
    transform: translateX(-2px);
    text-decoration: none;
    color: #ffffff;
}

.back-link {
    margin-bottom: 1rem;
}

.notice-banner {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-control);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notice-banner.warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.notice-banner.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ==========================================================================
   Single video (parent view)
   ========================================================================== */

.video-content {
    max-width: 900px;
    margin: 0 auto;
}

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 2rem;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    background: #000000;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-body {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.no-video-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--bears-red-dark);
    padding: 2rem;
    border-radius: var(--radius-card);
    text-align: center;
    margin-bottom: 2rem;
}

.view-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Login page

   Rendered as a standalone document by bears_render_login_page(), which links
   this stylesheet so the palette has a single source of truth.
   ========================================================================== */

.bears-login-body {
    background: linear-gradient(135deg, var(--bears-red) 0%, var(--bears-red-dark) 100%);
    margin: 0;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bears-login-card {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius-card);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.bears-login-logo {
    max-width: 150px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.bears-login-title {
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.bears-login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.bears-login-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--border-card);
    padding: 0.3rem;
    border-radius: var(--radius-control);
    margin-bottom: 1.5rem;
}

.bears-login-tab {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.bears-login-tab:hover {
    color: var(--text-heading);
}

.bears-login-tab.active {
    background: var(--surface);
    color: var(--bears-red);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.bears-login-panel {
    display: none;
}

.bears-login-panel.active {
    display: block;
}

.bears-login-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.bears-password-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-input);
    border-radius: var(--radius-control);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
    text-align: center;
}

.bears-password-input:focus {
    outline: none;
    border-color: var(--bears-red);
    box-shadow: 0 0 0 3px var(--bears-red-ring);
}

.bears-login-btn {
    background: linear-gradient(135deg, var(--bears-red), var(--bears-red-dark));
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-control);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.bears-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--bears-red-shadow);
}

.bears-login-error {
    color: var(--bears-red);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.bears-login-notice {
    color: #10b981;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 1rem;
    }

    .site-title {
        font-size: 1.4rem;
    }

    .main-navigation {
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-main {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bears-login-card {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-center { text-align: center; }
.text-red { color: var(--bears-red); }
.bg-red { background-color: var(--bears-red); }
.text-white { color: #ffffff; }
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
