:root {
    /* Light theme variables */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #495057;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding: 20px;
    padding-bottom: 120px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Daily Visitors Section */
.daily-visitors-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--border-color);
}

.daily-visitors-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.visitor-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
}

.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.counter-value {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    letter-spacing: -2px;
}

.counter-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.counter-info {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.counter-info small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.visitor-description {
    text-align: center;
    max-width: 600px;
    padding: 0 20px;
}

.visitor-description p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Bottom Support Banner */
.support-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
    overflow: hidden;
    z-index: 999;
    transition: transform 0.3s ease-out;
}

.support-banner-bottom.hidden {
    transform: translateY(100%);
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-banner-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1160px;
    margin: 0 auto;
}

.support-banner-icon {
    font-size: 48px;
    flex-shrink: 0;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20% {
        transform: scale(0.95);
    }
}

.support-banner-text {
    flex: 1;
    color: white;
}

.support-banner-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.support-banner-subtitle {
    font-size: 14px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.support-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.support-banner-toggle {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.support-banner-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.support-banner-toggle:active {
    transform: translateY(0);
}

.support-banner-crypto-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    max-height: 200px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}

.support-banner-crypto-section.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.crypto-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.crypto-mini:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.crypto-mini-label {
    font-weight: 600;
    color: white;
    font-size: 12px;
    min-width: 35px;
}

.crypto-mini-address {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crypto-mini-copy {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.crypto-mini-copy:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.crypto-mini-copy:active {
    transform: scale(0.95);
}

.support-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.support-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.support-banner.hidden {
    display: none;
}

h1,
h2,
h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-top: 5vh;
}

h1 a {
    color: var(--text-primary);
    text-decoration: none;
}

h1 a:hover {
    text-decoration: underline;
}

/* Hero Section Styles */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    transition: all 0.3s ease;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-occupancy {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.occupancy-number {
    font-size: 6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.occupancy-people {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.last-updated {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 20px;
}

.update-label {
    font-weight: 600;
    margin-right: 5px;
}

#relative-time {
    font-weight: 600;
    color: var(--text-primary);
}

.timestamp-absolute {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.travel-time {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.stats-container {
    margin-top: 2rem;
}

.stats-section {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stats-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stats-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 1rem;
}

.stat-item {
    flex: 1 1 220px;
    background-color: var(--bg-tertiary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-item strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Color coding for distribution stats */
.stat-low .stat-value {
    color: #10b981;
}

.stat-medium .stat-value {
    color: #f59e0b;
}

.stat-high .stat-value {
    color: #ef4444;
}

/* Chart Container */
.chart-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    min-height: 320px;
    width: 100%;
    display: block;
    position: relative;
    overflow: hidden;
}

.chart-container>div {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
}

.chart-container .js-plotly-plot {
    width: 100% !important;
}

.chart-container .plotly {
    width: 100% !important;
}

.chart-container svg {
    max-width: 100% !important;
}

.daily-averages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 1rem;
}

.day-stat {
    background-color: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.day-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.day-stat strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.day-stat .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.busy-periods {
    list-style: none;
}

.busy-period-item {
    padding: 15px 20px;
    margin-bottom: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.busy-period-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.busy-period-item strong {
    font-size: 1.1rem;
    font-weight: 600;
}

.busy-period-item .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.site-footer {
    margin-top: 4rem;
    padding: 2rem 0 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

.crypto-addresses {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crypto-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crypto-label {
    color: var(--text-secondary);
    min-width: 45px;
}

.crypto-address {
    font-family: monospace;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: nowrap;
    max-width: 200px;
}

.copy-button {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background-color: var(--bg-primary);
    transform: translateY(-1px);
}

.footer-bottom {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 80px;
    }

    /* Theme Toggle Mobile */
    .theme-toggle {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 15px;
        gap: 4px;
        width: auto;
        max-width: fit-content;
        white-space: nowrap;
    }

    /* Bottom Support Banner Mobile - Compact */
    .support-banner-bottom {
        padding: 8px 10px;
    }

    .support-banner-content {
        flex-direction: row;
        gap: 8px;
        text-align: left;
        align-items: center;
        justify-content: space-between;
    }

    .support-banner-icon {
        font-size: 24px;
        flex-shrink: 0;
    }

    .support-banner-text {
        flex: 1;
        min-width: 0;
    }

    .support-banner-title {
        font-size: 13px;
        margin-bottom: 0;
    }

    .support-banner-subtitle {
        font-size: 10px;
        display: none;
    }

    .support-banner-actions {
        flex-shrink: 0;
    }

    .support-banner-toggle {
        padding: 6px 12px;
        font-size: 11px;
        width: auto;
        max-width: none;
        white-space: nowrap;
    }

    .support-banner-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }

    .support-banner-crypto-section {
        width: 100%;
        padding: 10px 5px 0 5px;
        margin-top: 10px;
    }

    .crypto-mini {
        flex-wrap: wrap;
        justify-content: center;
        padding: 6px 10px;
    }

    .crypto-mini-address {
        max-width: 130px;
        font-size: 9px;
    }

    .crypto-mini-label {
        font-size: 11px;
    }

    .crypto-mini-copy {
        padding: 3px 6px;
        font-size: 12px;
    }

    .hero-section {
        padding: 25px 15px;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .occupancy-number {
        font-size: 4rem;
    }

    .occupancy-people {
        font-size: 1.2rem;
    }

    .status-badge {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .last-updated {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Daily Visitors Mobile */
    .visitor-counter {
        min-width: 250px;
        padding: 20px;
    }

    .counter-value {
        font-size: 3rem;
    }

    .counter-label {
        font-size: 1rem;
    }

    .visitor-description p {
        font-size: 0.85rem;
    }

    .timestamp-absolute {
        display: block;
        margin-top: 4px;
        font-size: 0.85rem;
    }

    .stats-section {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .stats-section h3 {
        font-size: 1.3rem;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-item {
        flex: 1 1 100%;
        padding: 15px;
    }

    .daily-averages {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .chart-container {
        padding: 10px;
        min-height: 300px;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Ensure Plotly charts fill container properly on mobile */
    .chart-container>div,
    .chart-container .plotly,
    .chart-container .js-plotly-plot,
    .chart-container .plot-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .chart-container svg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .chart-container .main-svg {
        width: 100% !important;
        max-width: 100% !important;
    }

    .busy-period-item {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .crypto-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .crypto-address {
        max-width: 88vw;
        width: 100%;
    }
}

/* Extra compact banner for very small screens */
@media (max-width: 400px) {
    .support-banner-bottom {
        padding: 6px 8px;
    }

    .support-banner-icon {
        font-size: 20px;
    }

    .support-banner-title {
        font-size: 12px;
    }

    .support-banner-toggle {
        padding: 5px 10px;
        font-size: 10px;
    }

    .support-banner-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
        top: 6px;
        right: 6px;
    }

    body {
        padding-bottom: 70px;
    }
}
