/* ==========================================================================
   IHC 24/7 Schedule Stylesheet
   
   Structure:
   1. Typography & Fonts
   2. Base Layout & Reset
   3. Header & Title
   4. Main Schedule Container
   5. Timeline Components (Ruler, Time Markers)
   6. Program Cards
   7. Card Interactions (Hover, Expansion)
   8. Zoom Controls
   9. Current Time Indicator
   10. Animations
   11. Responsive Design (Mobile)
   ========================================================================== */

/* ==========================================================================
   1. TYPOGRAPHY & FONTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;900&display=swap');

/* ==========================================================================
   2. BASE LAYOUT & RESET
   ========================================================================== */

body, html {
    margin: 0;
    font-family: 'Lato', sans-serif;
}

body {
    background-color: #373737;
}

body.noscroll {
    overflow: hidden;
}

/* ==========================================================================
   3. HEADER & TITLE
   ========================================================================== */

.header-container {
    position: sticky;
    top: 0;
    z-index: 1002;
    width: 100%;
    background-color: #1a1a1a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    padding: 15px 0;
}

.title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 75vw;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.title-logo {
    height: 60px;
    flex-shrink: 0;
}

.title-text-container h1 {
    font-weight: 900;
    font-size: 2.5em;
    letter-spacing: 0.2em;
    margin: 0;
    padding: 0 20px;
}

.title-text-container p {
    font-weight: 400;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0 0 0;
}

/* ==========================================================================
   4. MAIN SCHEDULE CONTAINER
   ========================================================================== */

.main-content-wrapper {
    width: 75vw;
    max-width: 1000px;
    margin: 4vh auto;
    display: flex;
    flex-direction: column;
}

.program-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    background-color: #1a1a1a;
    border-radius: 30px;
    padding: 0 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
}

#schedule-container .program-wrapper:first-child {
    padding-top: 30px;
}

#schedule-container .program-wrapper:last-child {
    padding-bottom: 30px;
}

/* ==========================================================================
   5. TIMELINE COMPONENTS
   ========================================================================== */

/* Side Columns */
.side-content {
    flex: 0 0 85px;
    min-width: 0;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.side-content.right {
    padding-top: 12em;
    padding-bottom: 12em;
    box-sizing: border-box;
}

/* Center Column */
.center-column {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Time Markers (Left Sidebar) */
.time-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

.time-list li {
    position: absolute;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.time-text {
    flex-shrink: 0;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: clamp(0.8em, 2.5vw, 0.8em);
    color: rgba(255, 255, 255, 0.7);
    width: 65px;
    text-align: right;
}

/* Timeline Ruler */
.timeline-ruler {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.timeline-line {
    position: absolute;
    width: 100%;
    left: 0;
    transform: translateY(-50%);
}

.timeline-line.hour-line {
    height: 2px;
    background-color: rgba(255, 255, 255, 0.4);
}

.timeline-line.half-hour-line {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    display: none;
}

.timeline-line.ten-minute-line {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    display: none;
}

.timeline-line.minute-line {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    display: none;
}

/* Zoom-dependent visibility for timeline markers */
.program-wrapper.zoom-level-half-hours .half-hour-line {
    display: block;
}

.program-wrapper.zoom-level-ten-minutes .half-hour-line,
.program-wrapper.zoom-level-ten-minutes .ten-minute-line {
    display: block;
}

.program-wrapper.zoom-level-minutes .half-hour-line,
.program-wrapper.zoom-level-minutes .ten-minute-line,
.program-wrapper.zoom-level-minutes .minute-line {
    display: block;
}

/* Time list visibility based on zoom */
.time-list li {
    display: none;
}

.time-list li.hour {
    display: flex;
}

.program-wrapper.zoom-level-half-hours .time-list li.half-hour {
    display: flex;
}

.program-wrapper.zoom-level-ten-minutes .time-list li.half-hour,
.program-wrapper.zoom-level-ten-minutes .time-list li.ten-minute {
    display: flex;
}

/* Day of Week Label (Right Sidebar) */
.day-of-week-sticky-wrapper {
    position: sticky;
    top: 50vh;
    height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.day-of-week {
    writing-mode: vertical-rl;
    font-weight: 900;
    font-size: 2em;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.7);
}

/* Content Background */
.content-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: calc(100% + 20px);
    background-color: #1a1a1a;
    z-index: 2;
    margin: -10px 0;
}

/* Program Container */
.program-content-container {
    position: relative;
    z-index: 3;
    height: 100%;
    width: 80%;
    max-width: 600px;
    min-width: 200px;
    margin: 0 auto;
}

/* ==========================================================================
   6. PROGRAM CARDS
   ========================================================================== */

.program-card {
    background-color: #ffffff;
    border-radius: 15px;
    display: flex;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: absolute;
    width: 100%;
    overflow: visible;
    border: 1px solid #1a1a1a;
    box-sizing: border-box;
    cursor: pointer;
    transform-origin: top center;
    transition: 
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.5s,
        border-width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    --text-bg-color: white;
}

.program-card:not(.expanded):hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 6;
}

/* Card Structure */
.red-cap {
    background-color: #aa2321;
    width: 30px;
    flex-shrink: 0;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
    transition: 
        background-color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-radius 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.content-area {
    flex-grow: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* Card Content Layout */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    flex-grow: 1;
    min-height: 0;
    transition: opacity 0.3s;
}

.bottom-row {
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 1;
    transition: opacity 0.3s;
    isolation: isolate;
}

.bottom-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-color: var(--text-bg-color);
    border-radius: 4px;
    mask-image: linear-gradient(to bottom, transparent, black 40%, black 100%, transparent);
    transition: background-color 0.5s;
}

/* Card Text Elements */
.program-name-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.program-name {
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    font-size: 1.3em;
    color: #1a1a1a;
    white-space: nowrap;
    transform-origin: left top;
    transition: 
        color 0.5s,
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        font-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.program-image {
    height: 100%;
    max-height: 100px;
    max-width: 100px;
    min-width: 25px;
    object-fit: contain;
    object-position: right top;
    flex-shrink: 100;
    transition: 
        max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        max-width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.person-name-wrapper,
.title-location-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.title-location-wrapper {
    margin-left: auto;
    padding-left: 15px;
    display: flex;
    justify-content: flex-end;
}

.person-name,
.title-location {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 1em;
    color: #666666;
    white-space: nowrap;
    transition: 
        color 0.5s,
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        font-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-top: 15px;
}

.person-name {
    transform-origin: left center;
}

.title-location {
    transform-origin: right center;
}

/* Card Height Adaptations */
.card-is-short .bottom-row,
.card-is-very-short .top-row {
    opacity: 0;
    pointer-events: none;
}

/* Start Time Indicator (Shown on Expansion) */
.start-time-indicator {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 900;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* ==========================================================================
   7. CARD STATES & INTERACTIONS
   ========================================================================== */

/* Past Programs */
.program-card.past {
    background-color: #d7d7d7;
    --text-bg-color: #d7d7d7;
}

.program-card.past .red-cap {
    background-color: #b05f5d;
}

.program-card.past .program-name {
    color: #747474;
}

.program-card.past .person-name,
.program-card.past .title-location {
    color: #888888;
}

/* Live Programs */
.program-card.is-live {
    background-color: rgb(255, 215, 215);
    --text-bg-color: rgb(255, 215, 215);
}

/* Current Program (Highlighted) */
.program-card.current {
    border-color: #aa2321;
    box-shadow: 0 0 0 3px #aa2321, 0 0 15px rgba(170, 35, 33, 0.7);
    z-index: 5;
}

.program-card.current .red-cap {
    border-top-left-radius: 11px;
    border-bottom-left-radius: 11px;
}

/* Expanded Card State */
#card-dim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: none;
    transition: background-color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.program-card.expanded {
    position: fixed !important;
    z-index: 1001;
    margin: 0;
    will-change: width, height, top, left, border-width, box-shadow;
    background-color: #ffffff;
    box-shadow: none;
    --text-bg-color: white;
    transition:
        width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.5s,
        border-width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.program-card.expanded.past {
    transition:
        width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.5s,
        border-width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.program-card.expanded .red-cap {
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
    background-color: #aa2321;
}

.program-card.expanded.animate-in {
    border-width: 5px;
    box-shadow: 0 0 0 3px #aa2321, 0 0 15px rgba(170, 35, 33, 0.7);
}

.program-card.expanded:not(.is-closing) .top-row,
.program-card.expanded:not(.is-closing) .bottom-row {
    opacity: 1;
}

.program-card.expanded.is-closing.card-is-short .bottom-row,
.program-card.expanded.is-closing.card-is-very-short .bottom-row,
.program-card.expanded.is-closing.card-is-very-short .top-row {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.program-card.expanded .program-name {
    color: #1a1a1a;
}

.program-card.expanded .person-name,
.program-card.expanded .title-location {
    color: #666666;
}

.program-card.expanded .start-time-indicator {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0.15s;
}

.program-card.expanded.is-closing .start-time-indicator {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    transition-delay: 0s;
}

/* ==========================================================================
   8. ZOOM CONTROLS
   ========================================================================== */

/* Desktop Slider */
.zoom-slider-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 12px;
}

.zoom-slider-container label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.slider-wrapper {
    width: 20px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    width: 200px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transform: rotate(-90deg);
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #aa2321;
    border-radius: 50%;
}

#zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #aa2321;
    border-radius: 50%;
}

/* Mobile Buttons */
.zoom-buttons-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zoom-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background-color: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.zoom-button.active {
    background-color: #aa2321;
    border-color: #aa2321;
}

/* ==========================================================================
   9. CURRENT TIME INDICATOR
   ========================================================================== */

.current-time-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #aa2321;
    z-index: 4;
    display: none;
    box-shadow: 0 0 15px #560f0e;
    transform: translateY(-50%);
}

/* ==========================================================================
   10. ANIMATIONS
   ========================================================================== */

@keyframes subtle-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
    100% {
        transform: scale(1);
    }
}

.can-be-clicked {
    animation: subtle-pulse 2s ease-in-out 1 forwards;
}

/* ==========================================================================
   11. RESPONSIVE DESIGN (Mobile & Tablet)
   ========================================================================== */

/* Tablet (1000px - 834px) */
@media (max-width: 1000px) and (min-width: 834px) {
    .main-content-wrapper,
    .title-wrapper {
        width: 750px;
    }
    
    .program-wrapper {
        padding: 0 20px;
    }
}

/* Small Tablet (833px and below) */
@media (max-width: 833px) {
    .main-content-wrapper,
    .title-wrapper {
        width: 90vw;
    }
    
    .program-wrapper {
        padding: 0 20px;
    }
    
    .title-text-container h1 {
        font-size: 2em;
    }
    
    .title-logo {
        height: 50px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    body {
        background-color: #1a1a1a;
    }
    
    .header-container {
        padding: 0;
        padding-top: env(safe-area-inset-top);
        background-color: #1a1a1a;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .main-content-wrapper {
        width: 100vw;
        margin: 20px 0;
        background-color: #373737;
    }
    
    .title-wrapper {
        width: 100vw;
        padding: 15px 20px;
        border-radius: 0;
        box-shadow: none;
        background-color: transparent;
        justify-content: flex-start;
        gap: 20px;
    }
    
    .title-logo.logo-right {
        display: none;
    }
    
    .title-text-container {
        text-align: left;
    }
    
    .program-wrapper {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .title-text-container h1 {
        font-size: 1.7em;
        letter-spacing: 0.08em;
        padding: 0;
    }
    
    .title-text-container p {
        font-size: 0.85em;
    }
    
    .title-logo {
        height: 45px;
    }
    
    .side-content {
        flex: 0 0 60px;
    }
    
    .time-text {
        width: 100%;
        font-size: 0.7em;
        white-space: nowrap;
        padding-right: 5px;
        padding-left: 10px;
        box-sizing: border-box;
    }
    
    .day-of-week {
        font-size: 1.5em;
    }
    
    .zoom-buttons-container {
        right: 25px;
        bottom: 25px;
    }
    
    .zoom-button {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }
    
    .content-area {
        padding: 12px 10px;
    }
    
    .bottom-row {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .program-name {
        font-size: 0.8em;
    }
    
    .person-name,
    .title-location {
        font-size: 0.7em;
    }
    
    .program-image {
        height: 100%;
        max-height: 50px;
        max-width: 50px;
    }
    
    .program-card.expanded .program-name {
        font-size: 1.3em;
    }
    
    .program-card.expanded .person-name,
    .program-card.expanded .title-location {
        font-size: 1em;
    }
    
    .program-card.expanded .program-image {
        max-height: 100px;
        max-width: 100px;
    }
}