/* Reset and base styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #030303;
    color: #ffffff;
    font-family: 'ShreeDev0714', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    padding: 50px 20px 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    flex: 1 0 auto;
}

/* Language header bar above all content */
#lang-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    padding: 12px 40px;
    pointer-events: none;
}

.lang-btn {
    position: relative;
    z-index: 101;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #aaaaaa;
    font-family: inherit;
    font-size: 1.8rem;
    font-weight: 100;
    padding: 2px 6px;
    cursor: pointer;
    transition: color 0.15s ease;
    user-select: none;
    pointer-events: auto;
}

.lang-btn:hover {
    color: #ffffff;
}

/* Dashboard: column layout for portrait (mobile) */
.dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.chance-group {
    position: relative;
}

/* Label above the chance number */
.chance-label {
    font-size: 0.75rem;
    font-weight: 100;
    color: #aaaaaa;
    text-align: center;
    line-height: 1.4;
    padding: 0 10px;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

/* Big number placeholder */
.big-number {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 7.68rem;
    font-weight: 100;
    color: #ffffff;
    line-height: 1;
    text-align: center;
    padding: 10px 0 0 0;
}

.percent-sign {
    font-size: 0.175em;
    font-weight: 100;
    color: #aaaaaa;
    line-height: 1;
    margin-top: 0.15em;
}

/* Warning label below the big number */
.warning-label {
    font-size: 0.8rem;
    font-weight: 300;
    color: #aaaaaa;
    text-align: center;
    min-height: 1.2em;
    line-height: 1.4;
    padding: 0 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.warning-hoisted {
    font-weight: 100;
    color: #888888;
    font-size: 0.75rem;
}

/* Fetch timestamp */
.fetch-time {
    font-size: 0.65rem;
    font-weight: 100;
    color: #666666;
    text-align: center;
    line-height: 1.4;
    padding: 0 10px;
}

.map-container {
    position: relative;
    background: transparent;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
}

.hk-map {
    display: block;
    width: 100%;
    height: auto;
    cursor: default;
}


/* Dot styling */
.dot {
    transition: fill 0.2s ease;
}


/* District group dimming - use CSS class instead of inline opacity on mobile */
.district-group.dimmed .dot {
    fill: #1a1a1a !important;
}

.district-group.highlighted .dot {
    fill: #ffffff !important;
}

/* District group selection */
.district-group.selected .dot {
    fill: #ffffff !important;
}

/* Old #prob-info-btn not needed anymore - replaced by .action-btn */

/* Bottom action buttons (info, share, refresh) */
.action-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 2px;
}

.action-btn {
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.0071em;
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    padding: 4px 14px;
    min-height: 30px;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.action-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.prob-info-tooltip {
    position: absolute;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444444;
    border-radius: 6px;
    padding: 10px 14px;
    pointer-events: none;
    z-index: 50;
    font-size: 0.7rem;
    line-height: 1.6;
    min-width: 200px;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
}

.prob-info-tooltip .tip-title {
    font-weight: 300;
    color: #ffffff;
    font-size: 0.75rem;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333333;
}

.prob-info-tooltip .tip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.prob-info-tooltip .tip-label {
    font-weight: 100;
    color: #888888;
}

.prob-info-tooltip .tip-val {
    font-weight: 300;
    color: #cccccc;
    text-align: right;
}

.prob-info-tooltip .tip-note {
    font-weight: 100;
    color: #666666;
    font-size: 0.65rem;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #333333;
    text-align: center;
}

/* Info panel - centered flow layout by default (mobile) */
.info-panel {
    position: static;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    pointer-events: none;
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: center;
}

.info-panel .info-panel-name {
    color: #ffffff;
    font-weight: 300;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.info-panel .info-panel-rain {
    color: #aaaaaa;
    font-weight: 100;
}

.info-panel .info-panel-wind {
    color: #aaaaaa;
    font-weight: 100;
}

.error-message {
    padding: 40px;
    text-align: center;
    color: #ff6666;
}

.loading {
    padding: 60px 20px;
    text-align: center;
    color: #888888;
    font-size: 0.9rem;
}

.segmented-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 12px;
}

.segmented-btn {
    position: relative;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.0071em;
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: none;
    padding: 8px 18px;
    min-height: 36px;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.segmented-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.segmented-btn.seg-left {
    border-radius: 100px 0 0 100px;
}

.segmented-btn.seg-right {
    border-radius: 0 100px 100px 0;
}

.segmented-btn.segmented-btn-active {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
}

.segmented-btn.segmented-btn-active:hover {
    background: rgba(255,255,255,0.2);
}

.error-message .error-detail {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}


.worst-btn-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 10px 0 2px;
}

.worst-btn {
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.0071em;
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    padding: 6px 16px;
    min-height: 32px;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.worst-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

/* Chart container */
.chart-container {
    width: 100%;
    padding: 4px 0;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 200;
    color: #ffffff;
    text-align: center;
    margin-bottom: 2px;
}

.chart-subtitle {
    font-size: 0.65rem;
    font-weight: 100;
    color: #666666;
    text-align: center;
    margin-bottom: 6px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    height: 56px;
}

.chart-rank {
    font-size: 0.7rem;
    font-weight: 200;
    color: #888888;
    min-width: 22px;
    text-align: right;
}

.chart-dot-row {
    flex: 1;
    overflow: hidden;
}

.chart-dots-svg {
    display: block;
    height: 56px;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
}

.chart-info {
    min-width: 80px;
    text-align: right;
}

.chart-name {
    font-size: 0.7rem;
    font-weight: 300;
    color: #cccccc;
    line-height: 1.2;
}

.chart-value {
    font-size: 0.65rem;
    font-weight: 100;
    color: #888888;
    line-height: 1.2;
}

.chart-empty {
    font-size: 0.75rem;
    font-weight: 100;
    color: #666666;
    text-align: center;
    padding: 30px 0;
}

/* Footer that always stays at the bottom of the page */
#legal-footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 30px 20px 20px;
}

#legal-footer a {
    color: #444444;
    font-size: 0.55rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.15s ease;
}

#legal-footer a:hover {
    color: #888888;
}

/* Landscape: column on left (chance group), map on right */
@media (orientation: landscape) {
    .dashboard {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        width: 100%;
    }

    .hk-map {
        opacity: 0.8;
    }

    .chance-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 0 0 auto;
        margin-left: 0;
        position: relative;
    }

    .chance-group .chance-label {
        font-size: 1rem;
    }

    .chance-group .big-number {
        flex: 0 0 auto;
        font-size: 10.4rem;
        text-align: center;
        padding: 0;
    }

    .chance-group .warning-label {
        font-size: 1rem;
    }

    .chance-group .fetch-time {
        font-size: 0.85rem;
    }

    .info-panel {
        position: absolute;
        bottom: 12px;
        right: 12px;
        width: auto;
        text-align: right;
    }

    .map-container {
        flex: 0 0 auto;
        width: 66%;
        margin-right: 0;
    }
}
