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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1), 0 1px 0 rgba(255,255,255,0.1);
    z-index: 1000;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    /* Smooth transition for hiding animation */
    max-height: 200px; /* Set a max-height for animation */
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-bottom 0.4s ease;
}

/* Header hidden state - collapses completely */
header.header-hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom: 0 solid transparent;
    pointer-events: none;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

@keyframes headerShine {
    0%, 100% { transform: translate(-20%, -20%); }
    50% { transform: translate(20%, 20%); }
}

header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(255,255,255,0.3), 0 4px 16px rgba(0,0,0,0.2);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #1a1a2e;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 1;
    position: relative;
    z-index: 1;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.3);
    line-height: 1.6;
    color: #334155;
}

#map {
    flex: 1;
    width: 100%;
    min-height: 0; /* Fix for flex children */
    position: relative;
    background: #e5e5e5; /* Fallback color while map loads */
    overflow: hidden; /* Ensure no overflow */
}

/* Let the map canvas render naturally - no forced backgrounds */
.maplibregl-map,
.mapboxgl-map {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.maplibregl-canvas-container,
.mapboxgl-canvas-container {
    width: 100% !important;
    height: 100% !important;
}

.maplibregl-canvas,
.mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Completely hide MapTiler branding and controls that create white banners */
.maplibregl-ctrl-logo,
.mapboxgl-ctrl-logo,
.maptiler-ctrl-logo,
.maplibregl-compact,
.mapboxgl-compact {
    display: none !important;
}

/* Hide attribution banner */
.maplibregl-ctrl-attrib,
.mapboxgl-ctrl-attrib,
.maplibregl-ctrl-attrib-inner,
.mapboxgl-ctrl-attrib-inner {
    display: none !important;
}

/* Remove any white backgrounds from map controls */
.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right,
.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    background: transparent !important;
}

/* Target any remaining white divs in map */
#map > div:not(.maplibregl-map):not(.mapboxgl-map) {
    background: transparent !important;
}

/* Style zoom controls */
.maplibregl-ctrl-group,
.mapboxgl-ctrl-group {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
}

.info-panel {
    position: absolute;
    top: 170px;
    left: 40px;
    /* Glassmorphism - transparent and blurry */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 2.5rem;
    border-radius: 28px;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.1),
        0 4px 16px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.5);
    z-index: 1000;
    min-width: 380px;
    max-width: 440px;
    border: 1px solid rgba(91,111,222,0.1);
    animation: slideInLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    transition: top 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Info panel moves up when header is hidden */
.info-panel.header-collapsed {
    top: 20px;
}

.info-panel:hover {
    box-shadow:
        0 24px 72px rgba(0,0,0,0.14),
        0 12px 32px rgba(91,111,222,0.1),
        inset 0 1px 0 rgba(255,255,255,1);
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #5B6FDE, #7056D0, #E57FE9);
    border-radius: 28px 28px 0 0;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.loading {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
    padding: 1rem 0;
}

.loading p {
    background: linear-gradient(135deg, #5B6FDE, #7056D0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
    letter-spacing: 0.2px;
    font-size: 1.05rem;
}

.spinner {
    border: 4px solid rgba(91, 111, 222, 0.1);
    border-top: 4px solid #5B6FDE;
    border-right: 4px solid #7056D0;
    border-bottom: 4px solid #E57FE9;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 1.5rem;
    box-shadow:
        0 8px 20px rgba(91, 111, 222, 0.15),
        inset 0 2px 4px rgba(91, 111, 222, 0.08);
}

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

.hidden {
    display: none !important;
}

.shabbos-info {
    animation: fadeIn 0.6s ease-in;
}

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

.shabbos-info h2 {
    color: #1a1a2e;
    font-size: 1.625rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    background: linear-gradient(135deg, #5B6FDE, #7056D0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.3px;
    position: relative;
    animation: slideIn 0.5s ease-out;
    line-height: 1.3;
}

.shabbos-info h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, #5B6FDE, #7056D0, #E57FE9);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(91, 111, 222, 0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.time-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    /* Lighter transparent background */
    background: rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid rgba(91, 111, 222, 0.08);
    animation: slideInUp 0.6s ease-out backwards;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.time-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #5B6FDE, #7056D0, #E57FE9);
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: 18px 0 0 18px;
}

.time-item:nth-child(1) { animation-delay: 0.1s; }
.time-item:nth-child(2) { animation-delay: 0.2s; }
.time-item:nth-child(3) { animation-delay: 0.3s; }
.time-item:nth-child(4) { animation-delay: 0.4s; }

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

.time-item:hover {
    transform: translateX(6px) translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1.5px solid rgba(91, 111, 222, 0.25);
    box-shadow:
        0 12px 32px rgba(91, 111, 222, 0.12),
        0 4px 12px rgba(0,0,0,0.08);
}

.time-item:active {
    transform: translateX(4px) translateY(0px);
    transition: all 0.15s ease;
}

.time-item:hover::before {
    opacity: 1;
}

.label {
    font-weight: 600;
    color: #475569;
    font-size: 1rem;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: color 0.3s ease;
}

.time-item:hover .label {
    color: #334155;
}

.time {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #5B6FDE, #7056D0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums;
}

.time-item:first-child {
    background: rgba(240, 244, 255, 0.6);
    border: 1.5px solid rgba(91, 111, 222, 0.15);
    box-shadow: 0 4px 12px rgba(91, 111, 222, 0.06);
}

.time-item:first-child:hover {
    box-shadow:
        0 16px 40px rgba(91, 111, 222, 0.15),
        0 6px 16px rgba(0,0,0,0.08);
}

.time-item:first-child .time {
    font-size: 1.875rem;
    background: linear-gradient(135deg, #5B6FDE, #7056D0, #E57FE9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.parsha {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7056D0, #E57FE9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

.date-display {
    margin-top: 2rem;
    text-align: center;
    color: #475569;
    font-size: 0.9375rem;
    font-weight: 500;
    animation: slideIn 0.8s ease-out 0.5s backwards;
    background: rgba(255, 255, 255, 0.4);
    padding: 1.125rem 1.5rem;
    border-radius: 16px;
    border: 1.5px solid rgba(91, 111, 222, 0.06);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    letter-spacing: 0.2px;
    line-height: 1.5;
}

.error-message {
    color: #DC2626;
    padding: 1.5rem;
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 100%);
    border-radius: 18px;
    text-align: center;
    border: 1.5px solid rgba(220, 38, 38, 0.15);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
    font-weight: 500;
    letter-spacing: 0.1px;
    line-height: 1.6;
}


/* Custom Marker Styles */
.custom-marker {
    position: relative;
    width: 50px;
    height: 60px;
}

.marker-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 60px;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

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

.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(91, 111, 222, 0.6) 0%, rgba(112, 86, 208, 0.2) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: markerPulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes markerPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Accessibility - Focus States */
.time-item:focus,
.time-item:focus-visible {
    outline: 2px solid #5B6FDE;
    outline-offset: 3px;
    border-color: rgba(91, 111, 222, 0.3);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .info-panel {
        top: 100px;
        left: 12px;
        right: 12px;
        min-width: auto;
        max-width: none;
        padding: 1rem;
        border-radius: 20px;
        /* Glassmorphism - transparent and blurry */
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    }

    /* Info panel when header is hidden on mobile */
    .info-panel.header-collapsed {
        top: 12px;
    }

    header {
        padding: 1rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .shabbos-info h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .time-item {
        padding: 0.625rem 0.875rem;
        border-radius: 12px;
        /* Lighter chip background */
        background: rgba(255, 255, 255, 0.6);
    }

    .time-item:first-child {
        background: rgba(240, 244, 255, 0.7);
    }

    .time-display {
        gap: 0.5rem;
    }

    .label {
        font-size: 0.8125rem;
    }

    .time {
        font-size: 1.125rem;
    }

    .time-item:first-child .time {
        font-size: 1.35rem;
    }

    .parsha {
        font-size: 0.9rem;
    }

    .date-display {
        font-size: 0.75rem;
        padding: 0.625rem 0.875rem;
        margin-top: 0.75rem;
        background: rgba(255, 255, 255, 0.5);
    }

    /* Custom marker smaller on mobile */
    .custom-marker {
        width: 40px;
        height: 48px;
    }

    .marker-pin {
        width: 40px;
        height: 48px;
    }

    .marker-pulse {
        width: 48px;
        height: 48px;
    }
}
