/* === NAVBAR.CSS — Навигация === */

app-header {
    display: contents; 
}

scroll-hint {
    display: block;
}

.navbar .nav-btn .icon-emoji {
  margin-left: -4px; /* отрицательный — двигает влево */
}

.navbar {
    background: rgba(0, 20, 60, 0.3);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    padding: 4px 0 2px 0;
    z-index: 9997;
    box-shadow: 0 4px 24px rgba(0, 20, 60, 0.12);
    overflow: visible;
}

/* 1. ГЛАВНЫЙ КОНТЕЙНЕР ДЛЯ ПРОКРУТКИ */
.nav-scroll-viewport {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 10px 4px 10px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    cursor: grab;
}

.nav-scroll-viewport::-webkit-scrollbar {
    display: none;
}

/* 2. ОБЕРТКА ДЛЯ РЯДОВ */
.nav-rows-wrapper {
    display: flex;
    flex-direction: column;
    width: max-content;
    gap: 7px;
    padding-top: 2px;
    min-width: 100%;
}

/* 3. СТИЛИ ДЛЯ РЯДОВ */
.nav-row {
    display: flex;
    gap: 11px;
    justify-content: flex-start;
    width: 100%;
}

a { 
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================== */
/* === КНОПКИ С КАРТИНКАМИ (только index.html) === */
/* ============================================== */

/* Переопределяем размер и убираем фон/рамку — картинка сама всё показывает */
.nav-btn--img {
    background: rgba(0, 30, 80, 0) !important;
    border: 1px solid rgba(255, 255, 255, 0) !important;
    padding: 0 !important;
    border-radius: 20px !important;
    width: 82px !important;
    height: 82px !important;
    min-width: 82px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Картинки внутри — заполняют кнопку */
.nav-btn--img img {
    width: 120% !important;
    height: 120% !important;
    object-fit: contain !important;
    transition: transform 0.25s ease;
    pointer-events: none; /* клик идёт по кнопке, не по img */
}

.nav-btn--img:hover img,
.nav-btn--img:active img {
    transform: scale(1.09);
}


/* Активная кнопка с картинкой — возвращаем синий градиент поверх */
.nav-btn--img.active {
    background: linear-gradient(135deg, rgba(0, 82, 155, 0.88) 0%, rgba(0, 120, 210, 0.88) 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* === КНОПКИ === */
.nav-btn {
    background: rgba(0, 30, 80, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 8px 12px;
    border-radius: 14px;
    white-space: nowrap;
    color: #d0eaff;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    font-family: 'Montserrat', 'Tektur', -apple-system, sans-serif;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    transform: translateZ(0);
    /* Убираем синий прямоугольник при нажатии на Android */
    -webkit-tap-highlight-color: transparent;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    opacity: 0;
    transform: translateX(-100%);
    transition: transform 0.4s ease, opacity 0.1s ease;
    pointer-events: none;
}

.nav-btn:hover::after {
    transform: translateX(160%);
    opacity: 1;
}

.nav-btn:hover {
    background: rgba(0, 30, 80, 0.50);
    border-color: rgba(255, 255, 255, 0.40);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 20, 60, 0.25);
    color: #ffffff;
}

.nav-btn:active {
    transform: translateY(0px) scale(0.97);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(0, 82, 155, 0.88) 0%, rgba(0, 120, 210, 0.88) 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 16px rgba(0, 82, 155, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-btn.active:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(0, 82, 155, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* === ССЫЛКИ === */
a.nav-btn {
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    font-size: 0.88rem;
    font-family: 'Aldrich', 'Montserrat', system-ui, -apple-system, sans-serif;
    color: #d0eaff !important;
    background: rgba(0, 30, 80, 0.35) !important;
}

a.nav-btn.active {
    background: linear-gradient(135deg, rgba(0, 82, 155, 0.88) 0%, rgba(0, 120, 210, 0.88) 100%) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 4px 16px rgba(0, 82, 155, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}

a.nav-btn:hover {
    background: rgba(0, 30, 80, 0.50) !important;
    border-color: rgba(255, 255, 255, 0.40) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 20, 60, 0.25) !important;
    color: #ffffff !important;
}

/* === СТИЛИ ДЛЯ ПОДСКАЗКИ И СТРЕЛОК === */
.scroll-hint-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    margin-bottom: 5px;
    margin-top: 5px;
    height: 26px;
}

.scroll-hint-text {
    font-size: 0.85rem;
    color: #d0eaff;
    font-style: italic;
    transform: translateY(5px);
}

.scroll-arrows {
    display: flex;
    gap: 8px;
}

.arrow-btn {
    color: #d0eaff;
    background: rgba(0, 30, 80, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: none;
    transform: translateY(0.1px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Убираем синий прямоугольник при нажатии на Android */
    -webkit-tap-highlight-color: transparent;
}

.arrow-btn:hover {
    background: rgba(0, 30, 80, 0.50);
    border-color: rgba(255, 255, 255, 0.40);
    box-shadow: 0 4px 14px rgba(0, 20, 60, 0.25);
    transform: translateY(-1px);
}

.swipe-finger-wrapper {
    width: 28px;
    height: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    transform: translateY(10px);
}

.swipe-finger {
    font-size: 1.2rem;
    display: inline-block;
    transform-origin: top center;
    animation: swipeRock 1.6s ease-in-out infinite;
}

@keyframes swipeRock {
    0%   { transform: rotate(-20deg); }
    40%  { transform: rotate(20deg); }
    70%  { transform: rotate(-20deg); }
    100% { transform: rotate(-20deg); }
}

.scroll-hint-left {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.5s ease;
}

.scroll-hint-left.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-top-btn {
    position: fixed;
    bottom: 40vh;
    right: 10px;
    width: 26px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 30, 80, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #d0eaff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    touch-action: none;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-top-btn.scrolling {
    transform: scale(0.75);
    opacity: 0.4;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .navbar {
        backdrop-filter: blur(12px) saturate(160%);
        -webkit-backdrop-filter: blur(12px) saturate(160%);
    }

    .nav-btn {
        font-weight: 600;
        font-size: 0.98rem;
        text-shadow: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-btn.active {
        font-weight: 600;
        font-size: 0.98rem;
        text-shadow: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .nav-btn--img {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    a.nav-btn {
        font-weight: 600;
        font-size: 0.98rem;
        text-shadow: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .scroll-hint-text {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .arrow-btn {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .scroll-top-btn {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .scroll-hint-left {
        display: none !important;
    }
}

@media (min-width: 768px) {
  .nav-rows-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .nav-row {
    justify-content: center;
  }
}
