/* ===============================================
   CSS Reset & Base Styles
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-hero: 'Barlow Condensed', sans-serif;
    --font-body: 'Kode Mono', monospace;
    --color-white: #ffffff;
    --color-overlay: rgba(0, 0, 0, 0.3);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--color-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===============================================
   Background Image Placeholder
   =============================================== */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
}

/* ===============================================
   Background Video
   =============================================== */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* ===============================================
   Vignette Overlay
   =============================================== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.25) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===============================================
   Navbar
   =============================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    z-index: 100;
    font-family: var(--font-body);
    font-weight: 500;
}

.navbar-left,
.navbar-right {
    font-size: 0.75rem;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.navbar-left {
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.navbar-left:hover {
    opacity: 1;
}

.navbar-right {
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    font-family: var(--font-body);
    font-weight: 500;
}

.navbar-right:hover {
    opacity: 1;
}

/* ===============================================
   Search Bar
   =============================================== */
.navbar-search {
    display: none;
    position: relative;
}

.mobile-search-container {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    padding: 0.2rem 1rem;
    z-index: 99;
    display: flex;
    justify-content: center;
}

.mobile-search-container .search-wrapper {
    position: relative;
}

.city-search {
    width: 100%;
    max-width: 600px;
    padding: 0.55rem 2.5rem 0.55rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-shadow: none;
}

.city-search::placeholder {
    color: rgba(0, 0, 0, 0.4);
    text-transform: none;
}

.city-search:focus {
    background: rgba(255, 255, 255, 1);
}

/* Hide native search input clear button */
.city-search::-webkit-search-cancel-button,
.city-search::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn.visible {
    opacity: 0.6;
}

.search-clear-btn:hover {
    opacity: 1;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: none;
}

.search-dropdown.hidden {
    display: none;
}

.search-dropdown-item {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ===============================================
   Main Container
   =============================================== */
.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1rem 1rem 1rem;
}

/* ===============================================
   Hero Section
   =============================================== */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex: 1;
    width: 100%;
    max-width: 600px;
    padding-top: 10px;
    margin-top: 54px; /* Space for mobile search bar */
}

.sea-lion {
    position: relative;
    width: min(370px, calc(40vh - 60px));
    height: auto;
    z-index: 2;
    filter: hue-rotate(0deg);
    transition: filter 0.5s ease;
    drop-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ===============================================
   Weather Info Section
   =============================================== */
.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(0rem, 0.3vh, 0.25rem);
    margin-top: clamp(0.25rem, 1vh, 0.75rem);
}

.city-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 6vh, 4.375rem);
    line-height: 1.1;
    color: var(--color-white);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.city-location {
    display: none;
}

.weather-condition {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(0.75rem, 2vh, 1.25rem);
    color: var(--color-white);
    opacity: 0.9;
    margin: clamp(0.15rem, 0.5vh, 0.5rem) 0 0 0;
    letter-spacing: 0.02em;
}

.humidity-arrow {
    position: relative;
    cursor: help;
    -webkit-tap-highlight-color: transparent;
}

.humidity-arrow::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0s, visibility 0s;
    pointer-events: none;
    margin-bottom: 4px;
    text-shadow: none;
}

.humidity-arrow:hover::after,
.humidity-arrow.tooltip-visible::after {
    opacity: 1;
    visibility: visible;
}

/* ===============================================
   City Input Section
   =============================================== */
.city-input-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-top: 0.5rem;
    z-index: 10;
}

.city-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    outline: none;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.city-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Hide native search input clear button */
.city-input::-webkit-search-cancel-button,
.city-input::-webkit-search-decoration,
.city-input::-webkit-search-results-button,
.city-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.city-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    opacity: 1;
}

.clear-btn.hidden {
    display: none;
}

/* ===============================================
   Autocomplete Dropdown
   =============================================== */
.autocomplete-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.autocomplete-message {
    padding: 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
}

/* ===============================================
   Footer
   =============================================== */
.footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 0.4rem;
    padding-bottom: max(0.4rem, 4px);
}

.footer-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    color: var(--color-white);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-link:hover {
    opacity: 1;
}

.footer-link-username {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-link-username:hover {
    opacity: 0.6;
}

/* ===============================================
   Modal
   =============================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 340px;
    width: 100%;
    position: relative;
}

.modal-content h2 {
    font-family: var(--font-hero);
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.modal-content p {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    opacity: 1;
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.color-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.color-circle.blue {
    background: #4a90a4;
}

.color-circle.pink {
    background: #a44a90;
}

.color-legend-text {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ===============================================
   Responsive Design
   =============================================== */
@media (min-width: 768px) {
    .navbar-left,
    .navbar-right {
        font-size: 1rem;
    }

    .navbar-search {
        display: flex;
        flex: 1;
        justify-content: center;
        padding: 0 2rem;
    }

    .navbar-search .search-wrapper {
        width: 100%;
        max-width: 600px;
    }

    .navbar-search .city-search {
        max-width: none;
    }

    .mobile-search-container {
        display: none;
    }

    .container {
        padding: 3rem 2rem 1.5rem 2rem;
    }

    .hero {
        max-width: 700px;
        margin-top: 0;
    }

    .sea-lion {
        width: min(518px, calc(50vh - 60px));
    }

    .city-name {
        font-size: clamp(2rem, 8vh, 6.125rem);
    }

    .weather-condition {
        font-size: clamp(0.9rem, 2.5vh, 1.75rem);
    }

    .city-input {
        font-size: 1.1rem;
        padding: 1rem 3rem 1rem 1.5rem;
    }

    .footer {
        flex-direction: row;
        gap: 3rem;
    }

    .footer-link {
        font-size: 0.95rem;
    }

    /* Modal - larger on tablet/desktop */
    .modal-content {
        padding: 2rem;
        max-width: 500px;
    }

    .modal-content h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .modal-content p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .color-legend {
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .color-circle {
        width: 24px;
        height: 24px;
    }

    .color-legend-text {
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    .hero {
        max-width: 800px;
    }

    .sea-lion {
        max-width: 475px;
    }
}
