/* ================================
   CVR Community Calendar - Week View
   ================================ */

:root {
    /* ABI Color Palette */
    --abi-orange: #E43600;
    --abi-dark: #222222;
    --abi-white: #FFFFFF;
    --cod-gray: #1A1A1A;
    --whisky-sour: #F0A530;
    --apple: #37BD3C;
    
    /* Theme Colors */
    --bg-color: #0d0d0d;
    --text-color: #FFFFFF;
    --accent-primary: #E43600;
    --accent-secondary: #F0A530;
    --accent-tertiary: #E43600;
    --accent-green: #37BD3C;
    --card-bg: rgba(26, 26, 26, 0.8);
    --card-hover: rgba(34, 34, 34, 0.9);
    --border-radius: 16px;
    --font-family: 'Inter', sans-serif;
    --day-width: 200px;
    --hour-width: 60px;
    --track-height: 90px;
    --header-height: 50px;
    --glow-primary: 0 0 40px rgba(228, 54, 0, 0.4);
    --glow-secondary: 0 0 40px rgba(240, 165, 48, 0.4);
}

/* Keyframe Animations */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

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

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(228, 54, 0, 0.6)); }
    50% { filter: drop-shadow(0 0 40px rgba(240, 165, 48, 0.8)); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(228, 54, 0, 0.5); }
    50% { border-color: rgba(240, 165, 48, 0.5); }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0a0a0a;
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overscroll-behavior-x: none;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(228, 54, 0, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(240, 165, 48, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(228, 54, 0, 0.08) 0%, transparent 40%);
    animation: gradientShift 15s ease infinite;
    background-size: 200% 200%;
    z-index: -2;
    pointer-events: none;
}

/* Hexagon Field Container */
.hexagon-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Individual Hexagon */
.hex {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    will-change: transform;
}

.hex::before {
    content: '';
    position: absolute;
    width: var(--size);
    height: calc(var(--size) * 1.1547);
    background: var(--color);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transform: translate(-50%, -50%);
}

/* Layer-based blur */
.hex.layer-1 {
    filter: none;
}

.hex.layer-2 {
    filter: blur(1px);
}

.hex.layer-3 {
    filter: blur(2.5px);
}

/* Container */
.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.8s ease-out;
}

/* Header */
header {
    margin-bottom: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(
        135deg,
        #E43600 0%,
        #F0A530 25%,
        #FFFFFF 50%,
        #F0A530 75%,
        #E43600 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -2px;
    animation: shimmer 15s linear infinite;
    text-shadow: 0 0 80px rgba(228, 54, 0, 0.5);
    position: relative;
}

h1::after {
    content: 'CVR Community Calendar';
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #E43600, #F0A530, #E43600);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: blur(30px);
    opacity: 0.5;
    z-index: -1;
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.zoom-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.25rem;
    font-style: italic;
    transition: opacity 0.3s ease;
}

.zoom-hint.hidden {
    opacity: 0;
}

/* Header Controls */
.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.75rem;
    align-items: flex-end;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.control-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Toggle Group - Glassmorphism */
.toggle-group {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 5px;
    border-radius: 14px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.toggle-group:hover {
    border-color: rgba(228, 54, 0, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(228, 54, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Sliding Background */
.toggle-bg {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    box-shadow: 
        0 4px 15px rgba(228, 54, 0, 0.4),
        0 0 30px rgba(240, 165, 48, 0.2);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.toggle-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.toggle-btn.active {
    color: #fff;
    background: transparent; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Timezone Info */
.timezone-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1rem;
    font-variant-numeric: tabular-nums;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

#user-timezone {
    background: linear-gradient(135deg, var(--whisky-sour), var(--abi-orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

/* Zoom Controls - Floating Pill */
.controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.4rem 0.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.controls:hover {
    transform: translateY(-4px);
    border-color: rgba(228, 54, 0, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(228, 54, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.controls button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.controls button:hover {
    transform: scale(1.1);
    border-color: var(--abi-orange);
    box-shadow: 0 0 20px rgba(228, 54, 0, 0.4);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.controls button#reset-zoom,
.controls button#jump-to-now {
    width: auto;
    padding: 0 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.controls button#jump-to-now {
    background: rgba(55, 189, 60, 0.15);
    border-color: rgba(55, 189, 60, 0.3);
}

.controls button#jump-to-now:hover {
    transform: scale(1.1);
    border-color: rgba(55, 189, 60, 0.6);
    box-shadow: 0 0 20px rgba(55, 189, 60, 0.4);
    background: linear-gradient(135deg, #37BD3C, #2a9e2e);
}

#zoom-level {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 50px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Timeline Wrapper */
.timeline-wrapper {
    position: relative;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 450px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: scaleIn 0.6s ease-out 0.5s backwards;
    transition: all 0.3s ease;
}

.timeline-wrapper:hover {
    border-color: rgba(228, 54, 0, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(228, 54, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(228, 54, 0, 0.5), 
        rgba(240, 165, 48, 0.5), 
        transparent
    );
    animation: shimmer 4s linear infinite;
    background-size: 200% 100%;
}

/* Scroll Area */
.timeline-scroll-area {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    cursor: grab;
}

.timeline-scroll-area:active {
    cursor: grabbing;
}

.timeline-scroll-area::-webkit-scrollbar {
    height: 10px;
}

.timeline-scroll-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
}

.timeline-scroll-area::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--abi-orange), var(--whisky-sour));
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(228, 54, 0, 0.5);
}

.timeline-scroll-area::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--whisky-sour), var(--abi-orange));
}

/* Time Axis */
.time-axis-container {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    flex-shrink: 0;
    will-change: width;
}

.time-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 10px;
    justify-content: flex-start;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
}

.time-marker:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Day Markers */
.time-marker.day-marker {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    border-left: 3px solid var(--abi-orange);
    background: linear-gradient(90deg, rgba(228, 54, 0, 0.2), transparent 50%);
    text-shadow: 0 0 20px rgba(228, 54, 0, 0.5);
}

.time-marker.day-marker .day-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-right: 8px;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Hour Markers (only visible when zoomed in) */
.time-marker.hour-marker {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.time-marker.hour-marker.visible {
    opacity: 1;
}

/* Events Container */
.events-track-container {
    position: relative;
    min-height: calc(100% - var(--header-height));
    flex: 1;
    will-change: width, background-size;
}

/* Grid Lines */
.grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    transition: left 0.2s ease;
}

.grid-line.day-line {
    width: 2px;
    background: rgba(228, 54, 0, 0.3);
}

.grid-line.hour-line {
    background: rgba(255, 255, 255, 0.02);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-line.hour-line.visible {
    opacity: 1;
}

/* Event Blocks - Glassmorphism */
.event-block {
    position: absolute;
    border-radius: 6px;
    padding: 2px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeInUp 0.5s ease-out backwards;
    min-width: 24px;
}

.event-block.show-details {
    padding: 4px 6px;
    border-radius: 8px;
}

/* Staggered animation for event blocks */
.event-block:nth-child(1) { animation-delay: 0.1s; }
.event-block:nth-child(2) { animation-delay: 0.15s; }
.event-block:nth-child(3) { animation-delay: 0.2s; }
.event-block:nth-child(4) { animation-delay: 0.25s; }
.event-block:nth-child(5) { animation-delay: 0.3s; }
.event-block:nth-child(6) { animation-delay: 0.35s; }
.event-block:nth-child(7) { animation-delay: 0.4s; }
.event-block:nth-child(8) { animation-delay: 0.45s; }

/* Animated gradient border */
.event-block::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 7px;
    background: linear-gradient(135deg, 
        rgba(228, 54, 0, 0.6), 
        rgba(240, 165, 48, 0.6),
        rgba(228, 54, 0, 0.6),
        rgba(240, 165, 48, 0.6)
    );
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 6s ease infinite;
}

.event-block.show-details::before {
    border-radius: 9px;
}

.event-block:hover::before {
    opacity: 1;
}

.event-block:hover {
    transform: translateY(-2px) scale(1.02);
    z-index: 10;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(228, 54, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.event-block.show-details:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(228, 54, 0, 0.2);
}

/* Event Color Schemes - Based on day using ABI palette (week starts Monday) */
.event-block.day-0 { /* Monday - Orange */
    background: linear-gradient(135deg, rgba(228, 54, 0, 0.25) 0%, rgba(180, 40, 0, 0.35) 100%);
    border-color: rgba(228, 54, 0, 0.4);
}
.event-block.day-0:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(228, 54, 0, 0.3);
}

.event-block.day-1 { /* Tuesday - Whisky */
    background: linear-gradient(135deg, rgba(240, 165, 48, 0.2) 0%, rgba(200, 130, 30, 0.3) 100%);
    border-color: rgba(240, 165, 48, 0.4);
}
.event-block.day-1:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(240, 165, 48, 0.3);
}

.event-block.day-2 { /* Wednesday - Orange-red */
    background: linear-gradient(135deg, rgba(228, 54, 0, 0.2) 0%, rgba(150, 35, 0, 0.3) 100%);
    border-color: rgba(228, 54, 0, 0.35);
}
.event-block.day-2:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(228, 54, 0, 0.3);
}

.event-block.day-3 { /* Thursday - Gold */
    background: linear-gradient(135deg, rgba(240, 165, 48, 0.25) 0%, rgba(180, 120, 20, 0.35) 100%);
    border-color: rgba(240, 165, 48, 0.45);
}
.event-block.day-3:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(240, 165, 48, 0.3);
}

.event-block.day-4 { /* Friday - Deep orange */
    background: linear-gradient(135deg, rgba(200, 80, 20, 0.2) 0%, rgba(150, 50, 10, 0.3) 100%);
    border-color: rgba(200, 80, 20, 0.4);
}
.event-block.day-4:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(200, 80, 20, 0.3);
}

.event-block.day-5 { /* Saturday - Bright orange */
    background: linear-gradient(135deg, rgba(228, 54, 0, 0.22) 0%, rgba(180, 45, 0, 0.32) 100%);
    border-color: rgba(228, 54, 0, 0.38);
}
.event-block.day-5:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(228, 54, 0, 0.3);
}

.event-block.day-6 { /* Sunday - Amber */
    background: linear-gradient(135deg, rgba(240, 165, 48, 0.22) 0%, rgba(190, 120, 25, 0.32) 100%);
    border-color: rgba(240, 165, 48, 0.42);
}
.event-block.day-6:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(240, 165, 48, 0.3);
}

/* Age restriction badge */
.event-age-badge {
    display: inline-block;
    background: linear-gradient(135deg, #E43600, #b32d00);
    color: #fff;
    font-size: 0.4rem;
    font-weight: 700;
    padding: 1px 2px;
    border-radius: 2px;
    flex-shrink: 0;
    line-height: 1;
}

.event-block.show-details .event-age-badge {
    font-size: 0.45rem;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Discord required badge */
.event-discord-badge {
    display: inline-block;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: #fff;
    font-size: 0.4rem;
    font-weight: 700;
    padding: 1px 2px;
    border-radius: 2px;
    flex-shrink: 0;
    line-height: 1;
}

.event-block.show-details .event-discord-badge {
    font-size: 0.45rem;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Discord required glow effect on event block */
.event-block.discord-required {
    box-shadow: 
        0 0 15px rgba(88, 101, 242, 0.3),
        inset 0 0 20px rgba(88, 101, 242, 0.1);
    border-color: rgba(88, 101, 242, 0.4) !important;
}

.event-block.discord-required:hover {
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(88, 101, 242, 0.4);
}

/* Event Content */
.event-badges {
    position: absolute;
    top: 2px;
    left: 2px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 2;
}

.event-block.show-details .event-badges {
    top: 4px;
    left: 4px;
    flex-direction: row;
    gap: 3px;
}

.event-title-vertical {
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.1;
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1px 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    max-width: 100%;
}

.event-block.show-details .event-title-vertical {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.85rem;
    font-weight: 700;
    flex: none;
    height: auto;
    padding: 0;
    margin: 18px 0 0 0;
    max-width: none;
    line-height: 1.2;
}

.event-time-compact {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

.event-block.show-details .event-time-compact {
    display: block;
    bottom: 4px;
    left: 4px;
    right: 4px;
}

/* Hover Info Card */
.event-tooltip {
    position: fixed;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1rem;
    min-width: 220px;
    max-width: 300px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.event-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(228, 54, 0, 0.2);
}

.tooltip-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip-live-badge {
    background: linear-gradient(135deg, #37BD3C, #2a9e2e);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.4rem;
}

.tooltip-row svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--accent-secondary);
}

.tooltip-recurrence {
    display: inline-block;
    background: rgba(228, 54, 0, 0.15);
    border: 1px solid rgba(228, 54, 0, 0.2);
    color: var(--abi-orange);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-age-badge {
    display: inline-block;
    background: linear-gradient(135deg, #E43600, #b32d00);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.tooltip-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --track-height: 48px;
        --header-height: 40px;
    }
    
    h1 { 
        font-size: 1.8rem; 
        letter-spacing: -1px;
    }
    
    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    .header-controls {
        gap: 1rem;
    }
    
    .toggle-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .event-title-vertical { font-size: 0.55rem; }
    .event-block.show-details { padding: 3px 4px; }
    .event-block.show-details .event-title-vertical { margin-top: 14px; }
    
    .controls {
        bottom: 12px;
        right: 12px;
        padding: 0.5rem 0.8rem;
    }
    
    .controls button {
        width: 32px;
        height: 32px;
    }
    
    body::after {
        opacity: 0.4;
    }
    
    .event-live-badge,
    .event-age-badge,
    .event-recurrence-badge {
        font-size: 0.4rem;
        padding: 1px 2px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    
    .toggle-group {
        padding: 3px;
    }
    
    .toggle-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .container {
        padding: 0.5rem 0;
    }
    
    header {
        margin-bottom: 0.5rem;
    }
    
    .countdown-container {
        margin: 0.5rem 0;
        padding: 0.75rem 1rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Selection Styling */
::selection {
    background: rgba(228, 54, 0, 0.4);
    color: #fff;
}

/* Focus States for Accessibility */
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.toggle-btn:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: -2px;
}

/* ================================
   COUNTDOWN TIMER
   ================================ */

.countdown-container {
    margin: 0.75rem 0;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s ease-out 0.25s backwards;
    position: relative;
    overflow: hidden;
}

.countdown-container:hover {
    border-color: rgba(228, 54, 0, 0.2);
}

.countdown-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(228, 54, 0, 0.1) 0%, 
        rgba(240, 165, 48, 0.05) 50%,
        rgba(228, 54, 0, 0.1) 100%
    );
    pointer-events: none;
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    font-weight: 600;
    position: relative;
}

.countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.countdown-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.countdown-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 40px rgba(228, 54, 0, 0.5);
}

.countdown-unit {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
    font-weight: 500;
}

.countdown-separator {
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
    animation: pulse 1s ease-in-out infinite;
}

.countdown-event-name {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-top: 0.5rem;
    font-weight: 600;
    position: relative;
    min-height: 1.2em;
}

.countdown-container.event-active {
    border-color: rgba(55, 189, 60, 0.4);
}

.countdown-container.event-active::before {
    background: linear-gradient(135deg, 
        rgba(55, 189, 60, 0.15) 0%, 
        rgba(55, 189, 60, 0.1) 100%
    );
}

.countdown-container.event-active .countdown-label {
    color: rgba(55, 189, 60, 0.9);
}

/* ================================
   NOW INDICATOR
   ================================ */

.now-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 50;
    pointer-events: none;
    display: none;
}

.now-indicator.visible {
    display: block;
}

.now-indicator-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: linear-gradient(180deg, 
        var(--abi-orange) 0%,
        var(--whisky-sour) 50%,
        var(--abi-orange) 100%
    );
    box-shadow: 
        0 0 10px var(--abi-orange),
        0 0 20px var(--abi-orange),
        0 0 40px rgba(228, 54, 0, 0.3);
}

.now-indicator-label {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--abi-orange), var(--whisky-sour));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(228, 54, 0, 0.4);
}

/* Active Event Styling - Using Apple green with pulsing glow */
@keyframes liveGlow {
    0%, 100% {
        box-shadow: 
            0 0 15px rgba(55, 189, 60, 0.4),
            0 0 30px rgba(55, 189, 60, 0.2),
            inset 0 0 15px rgba(55, 189, 60, 0.1);
        border-color: rgba(55, 189, 60, 0.6);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(55, 189, 60, 0.6),
            0 0 50px rgba(55, 189, 60, 0.3),
            inset 0 0 20px rgba(55, 189, 60, 0.15);
        border-color: rgba(55, 189, 60, 0.8);
    }
}

.event-block.event-active {
    border-color: rgba(55, 189, 60, 0.6) !important;
    box-shadow: 
        0 0 15px rgba(55, 189, 60, 0.3),
        inset 0 0 15px rgba(55, 189, 60, 0.1);
    animation: liveGlow 2s ease-in-out infinite;
}

.event-block.event-active .event-live-badge {
    display: inline-block;
}

.event-live-badge {
    display: none;
    background: linear-gradient(135deg, #37BD3C, #2a9e2e);
    color: #fff;
    font-size: 0.4rem;
    font-weight: 700;
    padding: 1px 2px;
    border-radius: 2px;
    letter-spacing: 0.3px;
    animation: pulse 2s ease-in-out infinite;
    line-height: 1;
}

.event-block.show-details .event-live-badge {
    font-size: 0.5rem;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ================================
   EVENT MODAL
   ================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    border-color: rgba(228, 54, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-close:hover {
    background: rgba(228, 54, 0, 0.15);
    border-color: rgba(228, 54, 0, 0.3);
    color: var(--abi-orange);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-right: 3rem;
}

.modal-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-status.upcoming {
    background: rgba(228, 54, 0, 0.2);
    color: var(--abi-orange);
    border: 1px solid rgba(228, 54, 0, 0.3);
}

.modal-status.live {
    background: rgba(55, 189, 60, 0.2);
    color: #37BD3C;
    border: 1px solid rgba(55, 189, 60, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.modal-status.ended {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-recurrence {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.modal-info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.modal-info-row svg {
    flex-shrink: 0;
    color: var(--accent-secondary);
}

/* Server code section in modal */
.modal-server-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.modal-server-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-server-label svg {
    width: 16px;
    height: 16px;
    fill: #5865F2;
}

.modal-server-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-server-code {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-server-url {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--abi-orange);
    background: rgba(228, 54, 0, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(228, 54, 0, 0.2);
    letter-spacing: 0.5px;
    word-break: break-all;
}

.modal-server-url a {
    color: var(--abi-orange);
    text-decoration: none;
}

.modal-server-url a:hover {
    text-decoration: underline;
}

.modal-server-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    padding-left: 0.5rem;
}

.modal-qr-code {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.modal-qr-code svg {
    width: 100%;
    height: 100%;
}

.modal-discord-row {
    color: #5865F2 !important;
    font-weight: 600;
}

.modal-discord-row svg {
    color: #5865F2 !important;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--abi-orange), var(--whisky-sour));
    color: #fff;
    box-shadow: 0 4px 20px rgba(228, 54, 0, 0.4);
}

.modal-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(228, 54, 0, 0.5);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(228, 54, 0, 0.3);
    transform: translateY(-3px);
}

/* ================================
   RESPONSIVE ADDITIONS
   ================================ */

@media (max-width: 768px) {
    .countdown-container {
        padding: 0.75rem 1.25rem;
        margin: 0.5rem 0;
    }
    
    .countdown-value {
        font-size: 2rem;
    }
    
    .countdown-segment {
        min-width: 50px;
    }
    
    .countdown-separator {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .countdown-label {
        margin-bottom: 0.4rem;
    }
    
    .modal {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        padding: 0.9rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .countdown-segment {
        min-width: 40px;
    }
    
    .countdown-unit {
        font-size: 0.6rem;
    }
}

/* ================================
   LOADING SCREEN
   ================================ */

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes loadingBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes loadingFadeOut {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

.loading-screen {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loadingFadeOut 0.5s ease-out 1.2s forwards;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: loadingPulse 1s ease-in-out infinite;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--abi-orange), var(--whisky-sour));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--abi-orange), var(--whisky-sour));
    border-radius: 2px;
    animation: loadingBar 1s ease-out forwards;
}


/* ================================
   FOOTER
   ================================ */

.site-footer {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.footer-brand {
    font-weight: 600;
    background: linear-gradient(135deg, var(--abi-orange), var(--whisky-sour));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-divider {
    opacity: 0.3;
}

.event-count {
    color: rgba(255, 255, 255, 0.5);
}

.footer-shortcuts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

.shortcut-label {
    margin-right: 0.25rem;
}

.footer-disclaimer {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.footer-discord {
    margin-top: 0.75rem;
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(228, 54, 0, 0.1);
    border: 1px solid rgba(228, 54, 0, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ================================
   ADDITIONAL RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-shortcuts {
        display: none;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        font-size: 3rem;
    }
    
    .loading-text {
        font-size: 1.2rem;
    }
    
    .loading-bar {
        width: 150px;
    }
}
