/* === TOPBAR & HEADER CSS === */

/* --- ВЕРХНЯЯ ПАНЕЛЬ (TOP BAR) --- */
.top-bar {
    background: rgba(0, 30, 80, 0.35);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 9999 !important;
    padding: 0;
    overflow: visible !important;
    height: 30px;
    box-shadow: 0 2px 20px rgba(0, 20, 60, 0.18);
}

.top-bar-content {
    display: flex;
    align-items: flex-start;
    height: 30px;
    gap: 0;
    width: 100%;
    overflow: visible !important;
    position: relative;
    overscroll-behavior: none;
}

/* --- ШАПКА САЙТА (SITE HEADER) --- */
.site-header {
    background: rgba(0, 30, 80, 0.25);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 30px;
    z-index: 9998;
    padding: 0;
    width: 100%;
    height: 90px;
    overflow: visible;
}

/* Контейнер для текста — не растягивается */
.site-header-text {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Картинка — абсолютно позиционируется, не двигает соседей */
.site-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 5px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    z-index: 1;
}

.site-title img {
    height: auto;
    width: 100%;
    max-width: 600px;
    display: block;
    object-fit: contain;
    margin-top: -54px;
}

/* Subtitle — прибит к низу хедера */
.site-subtitle {
    position: absolute;
    bottom: 26px;          /* было 8px — увеличил, поднимется вверх */
    left: 92px;           /* было 100px — увеличил, сдвинется вправо */
    right: 74px;           /* было 75px — уменьшил, центр сместится вправо */
    text-align: center;
    color: rgba(200, 225, 255, 0.85);
    font-size: 0.80rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* --- ЭЛЕМЕНТЫ ВНУТРИ TOP BAR --- */
.date-time-block,
.weather-info,
.weather-arrow-btn {
    height: 30px;
    box-sizing: border-box;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    align-self: flex-start;
}

/* --- БЛОК ДАТЫ И ВРЕМЕНИ --- */
.date-time-block {
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
    width: 70px;
    min-width: 70px;
    gap: 0;
    position: relative;
    background: rgba(255, 255, 255, 0.14);
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: none;
}

#current-date,
#current-time,
#current-seconds {
    color: #d0eaff;
    text-shadow: none;
    margin: 0;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    position: relative;
    top: 2px;
}

#current-date {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1px;
    opacity: 0.85;
}

#current-time {
    font-size: 0.65rem;
    letter-spacing: 0.02px;
}

#current-seconds {
    font-size: 0.62rem;
    letter-spacing: -0.2px;
    opacity: 0.75;
}

/* --- КОНТЕЙНЕР СКРОЛЛА --- */
.weather-scroll-container {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
    scroll-behavior: smooth;
    padding: 0;
    padding-bottom: 55px;
    margin: 0;
    margin-bottom: -55px;
    gap: 0;
    overscroll-behavior-x: none;
    align-self: flex-start;
}

.weather-scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- ИНФО О ПОГОДЕ --- */
.weather-info {
    background: rgba(255, 255, 255, 0.14);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0;
    gap: 0;
    padding: 0 6px;
    margin: 0;
    flex-wrap: nowrap;
    pointer-events: all;
    min-width: 100%;
    justify-content: space-evenly;
}

.w-item {
    position: relative;
    white-space: nowrap;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 8px;
    font-size: 0.82rem;
    color: #d0eaff;
    flex-shrink: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.w-item:active {
    opacity: 0.7;
    transform: scale(0.97);
}

.divider {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 2px;
    font-weight: 300;
}

/* --- КНОПКА-СТРЕЛКА --- */
.weather-arrow-btn {
    position: relative;
    padding: 0 8px;
    cursor: pointer;
    color: #d0eaff;
    font-size: 0.9rem;
    font-weight: bold;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease;
    pointer-events: all;
}

.weather-arrow-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.weather-arrow-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.30);
}

/* --- ВСПЛЫВАЮЩИЕ ПОДСКАЗКИ --- */
.w-label {
    display: none !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 30, 80, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #d0eaff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.w-item.show-text .w-label {
    display: block !important;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(20px) scale(1); }
}

.lang-btn {
    position: absolute;
    top: 55px;
    right: 15px;
    z-index: 9997;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 4px 10px;
    font-size: 0.7rem;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    color: #d0eaff;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: box-shadow 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    overflow: hidden;
}

.lang-btn:active,
.lang-btn.is-active {
    transform: scale(0.96);
    opacity: 0.85;
    transition: all 0.1s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.lang-btn:not(:hover) {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
}

.lang-btn .icon-emoji {
    width: 14px !important;
    height: 14px !important;
    margin-right: 0;
    flex-shrink: 0;
}

.icon-emoji {
    width: 22px;
    height: 22px;
}

/* EUR Rate Widget */
.eur-rate-widget {
    position: absolute;
    top: 64px;
    left: 6px;
    z-index: 9997;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 2px 3px 1px 3px;
    font-size: 0.7rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    color: #d0eaff;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    overflow: hidden;
    cursor: default;
    white-space: nowrap;
    line-height: 1;
}

.eur-rate-widget .icon-1f1ea-1f1fa {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    line-height: 1;
    margin-bottom: 1px;
}

.eur-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #d0eaff;
    line-height: 1;
    margin-top: 2px;
}

.eur-value {
    font-size: 0.65rem;
    font-weight: 600;
    color: #d0eaff;
    line-height: 1;
    margin-top: 2px;
}

/* === PC font rendering fix === */
@media (hover: hover) and (pointer: fine) {
    .date-time-block {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    #current-date,
    #current-time,
    #current-seconds {
        font-weight: 500;
        text-shadow: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .site-title {
        top: -45px !important;     /* двигаем весь блок картинки вверх */
    }

    .site-title img {
        opacity: 1;
    }

    .site-subtitle {
        font-weight: 500;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        opacity: 0.88;
        bottom: 20px;
    }

    .site-header {
        background: rgba(0, 30, 80, 0.45);
        backdrop-filter: blur(10px) saturate(140%);
        -webkit-backdrop-filter: blur(10px) saturate(140%);
    }

    .lang-btn:hover {
        background: rgba(255, 255, 255, 0.26);
        box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
        transform: translateY(-1px);
    }

    .lang-btn:active,
    .lang-btn.is-active {
        transform: scale(0.96);
        opacity: 0.85;
        transition: all 0.1s ease;
    }
}
