/**
 * Lions Gameday Stylesheet
 * lionsgameday.com
 *
 * Color Palette:
 * - Honolulu Blue: #0076B6
 * - White: #FFFFFF
 * - Black: #000000
 * - Dark Charcoal: #1D252C
 * - Light Gray: #F5F5F5
 */

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --honolulu-blue: #0076B6;
    --honolulu-blue-dark: #005a8c;
    --honolulu-blue-light: #0091e0;
    --white: #FFFFFF;
    --cream: #FFFEF5;
    --black: #000000;
    --dark-charcoal: #1D252C;
    --light-gray: #F5F5F5;
    --medium-gray: #6c757d;
    --card-border: #E0DCD8;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 25px rgba(0, 118, 182, 0.25);
    --transition-speed: 0.3s;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--black);
    background-color: var(--white);
    min-height: 100vh;
    /* Safari fix: use -webkit-fill-available as fallback */
    min-height: -webkit-fill-available;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
}

/* ========================================
   Header Styles
   ======================================== */
.site-header {
    background-color: var(--white);
    border-bottom: 3px solid var(--honolulu-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--honolulu-blue);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color var(--transition-speed);
}

.site-logo:hover {
    color: var(--honolulu-blue-dark);
}

.site-logo span {
    color: var(--dark-charcoal);
}

.site-logo em {
    font-style: normal;
    font-weight: 400;
    font-size: 0.7em;
    color: var(--medium-gray);
    margin-left: 0.5rem;
    letter-spacing: 1px;
}

/* Site Branding Container */
.site-branding {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 0.25rem;
}

/* Safari fallback for gap */
.site-branding > * + * {
    margin-top: 0.25rem;
}

/* Site Tagline */
.site-tagline {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--medium-gray);
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
}

.main-nav {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 0.5rem;
}

/* Safari fallback for gap */
.main-nav > * + * {
    margin-left: 0.5rem;
}

.nav-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--honolulu-blue);
    background-color: transparent;
    border: 2px solid var(--honolulu-blue);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.nav-btn:hover {
    background-color: var(--honolulu-blue);
    color: var(--white);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--honolulu-blue);
    margin: 5px 0;
    transition: var(--transition-speed);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    -webkit-box-flex: 1;
    -webkit-flex: 1 0 auto;
    flex: 1 0 auto;
    padding: 0 2rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Shuffle Button Section - Fixed floating button on desktop */
.shuffle-section {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    margin: 0;
}

.shuffle-btn {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background-color: var(--honolulu-blue);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--card-shadow);
}

.shuffle-btn:hover {
    background-color: var(--honolulu-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

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

.shuffle-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem; /* Safari fallback for gap */
    transition: transform 0.5s ease;
}

.shuffle-btn:hover svg {
    transform: rotate(180deg);
}

/* ========================================
   Program Cards Grid
   ======================================== */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0 1rem 0;
}

.program-card {
    background-color: var(--cream);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: all var(--transition-speed);
    position: relative;
}

.program-card:hover {
    transform: translateY(-5px) rotate(0.5deg);
    box-shadow: var(--card-shadow-hover);
}

/* Score Row - contains score and attended badge */
.card-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-score-row .card-score {
    margin-bottom: 0;
}

/* Attended Badge - admission ticket icon */
.attended-badge {
    width: 36px;
    height: auto;
    flex-shrink: 0;
}

.program-card:hover .attended-badge {
    transform: scale(1.1);
}

/* Card Image Container */
.card-image {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 3/4;
    background-color: var(--light-gray);
    /* Image protection for Safari - applied to container since img has pointer-events:none */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.card-image img:not(.attended-badge) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
    /* Image protection - prevent saving via long-press */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.program-card:hover .card-image img {
    transform: scale(1.05);
}

/* Image overlay on hover */
.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 118, 182, 0);
    transition: background var(--transition-speed);
    pointer-events: none;
}

.program-card:hover .card-image::after {
    background: rgba(0, 118, 182, 0.1);
}

/* View icon on hover */
.card-image::before {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    opacity: 0;
    transition: all var(--transition-speed);
    z-index: 5;
}

.program-card:hover .card-image::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Card Info */
.card-info {
    position: relative;
    padding: 1rem;
    background-color: var(--cream);
}

.card-date {
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-bottom: 0.25rem;
}

.card-opponent {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin-bottom: 0.25rem;
}

.card-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    background-color: var(--honolulu-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.card-type.playoffs {
    background-color: #c9243f;
}

.card-type.preseason {
    background-color: var(--medium-gray);
}

.card-score {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-charcoal);
}

.card-score.win {
    color: #4A7C59;
}

.card-score.loss {
    color: #8B3A3A;
}

.card-score.tie {
    color: var(--medium-gray);
}

/* ========================================
   Lightbox Styles
   ======================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    /* Image protection for Safari */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);

    /* Clip upper-left corner at 45-degree angle (disabled for now)
    clip-path: polygon(
        40px 0,
        100% 0,
        100% 100%,
        0 100%,
        0 40px
    );
    border-top-left-radius: 0;
    */

    /* Image protection - prevent saving via long-press */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    transition: color var(--transition-speed);
    background: none;
    border: none;
}

.lightbox-close:hover {
    color: var(--honolulu-blue-light);
}

.lightbox-caption {
    text-align: center;
    color: var(--white);
    padding: 1rem;
    font-size: 1.1rem;
}

.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.lightbox.loading .lightbox-spinner {
    display: block;
}

.lightbox.loading .lightbox-content img {
    opacity: 0;
}

.lightbox.loading .lightbox-close,
.lightbox.loading .lightbox-caption {
    display: none;
}

/* ========================================
   Content Pages (About, Contact, etc.)
   ======================================== */
.content-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.content-container {
    background: var(--white);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.content-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--honolulu-blue);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--honolulu-blue);
}

.content-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-charcoal);
}

.content-body .lead {
    font-size: 1.3rem;
    color: var(--medium-gray);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.content-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-charcoal);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content-body p {
    margin-bottom: 1.5rem;
}

.content-body p:last-of-type {
    margin-bottom: 0;
}

.content-body a {
    color: var(--honolulu-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-speed);
}

.content-body a:hover {
    border-bottom-color: var(--honolulu-blue);
}

/* Special Content Boxes */
.highlight-box {
    background-color: var(--light-gray);
    border-left: 4px solid var(--honolulu-blue);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box p {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.not-for-sale-box {
    /* Fallback for Safari */
    background-color: #0076B6;
    background: -webkit-linear-gradient(315deg, #0076B6 0%, #005a8c 100%);
    background: linear-gradient(135deg, var(--honolulu-blue) 0%, var(--honolulu-blue-dark) 100%);
    color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.not-for-sale-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.not-for-sale-box p {
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.disclaimer-box {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.disclaimer-box h3 {
    color: #856404;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.disclaimer-box p {
    color: #856404;
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.7;
}

/* ========================================
   Footer Styles
   ======================================== */
.site-footer {
    background-color: var(--dark-charcoal);
    color: var(--white);
    padding: 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-copyright a {
    color: var(--honolulu-blue-light);
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* ========================================
   Loading Spinner
   ======================================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--honolulu-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Floating Action Button (FAB) for mobile
   ======================================== */
.shuffle-fab {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--honolulu-blue);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1100;
    transition: all var(--transition-speed);
    padding: 0;
    align-items: center;
    justify-content: center;
}

/* iOS safe area support */
.shuffle-fab {
    bottom: calc(24px + env(safe-area-inset-bottom));
}

.shuffle-fab:hover {
    background-color: var(--honolulu-blue-dark);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.shuffle-fab:active {
    transform: translateY(-2px);
}

.shuffle-fab svg {
    width: 24px;
    height: 24px;
    transition: transform 0.5s ease;
}

.shuffle-fab:hover svg {
    transform: rotate(180deg);
}

/* Loading state for FAB - just spin the icon */
.shuffle-fab.loading svg {
    animation: spin 1s linear infinite;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-container {
        padding: 1rem;
    }

    .site-tagline {
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .programs-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .site-logo {
        font-size: 1.25rem;
    }

    .site-tagline {
        font-size: 0.75rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .main-nav.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        padding: 0 1rem 1rem 1rem;
    }

    .attended-badge {
        width: 30px;
    }

    /* Content pages on mobile */
    .content-page {
        padding: 2rem 1rem;
    }

    .content-container {
        padding: 2rem;
    }

    /* Show FAB on mobile */
    .shuffle-fab {
        display: flex;
    }

    /* Hide desktop shuffle section */
    .shuffle-section {
        display: none;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem;
    }

    .site-logo {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .site-tagline {
        display: none;
    }

    .card-info {
        padding: 0.75rem;
    }

    /* Content pages on small mobile */
    .content-container {
        padding: 1.5rem;
    }

    .content-page h1 {
        font-size: 1.5rem;
    }

    .content-body {
        font-size: 1rem;
    }

    .content-body .lead {
        font-size: 1.1rem;
    }

    .content-body h2 {
        font-size: 1.25rem;
    }

    /* Special boxes on small mobile */
    .highlight-box,
    .not-for-sale-box,
    .disclaimer-box {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .highlight-box p,
    .not-for-sale-box p,
    .disclaimer-box p {
        font-size: 0.95rem;
    }

    .not-for-sale-box h3,
    .disclaimer-box h3 {
        font-size: 1rem;
    }
}
