:root {
    --primary-color: #0ee071;
    --secondary-color: #141a17;
    --background-dark: #0e0e0e;
    --background-black: #000000;
    --background-map: #090909;
    --sidebar-bg: rgba(32, 32, 32, 0.4);
    --text-light: #ffffff;
    --text-dark: #000000;
    --text-muted: #3c5146;
    --border-dark: #1e1e1e;
    --shadow-dark: #111;
    --disabled-bg: #333f39;
    --disabled-text: #6e6e6e;
    --accent-pink: #f92672;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Mono', monospace;
}

body {
    background: var(--background-dark);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

.container {
    position: relative;
    height: 100vh;
    padding: 12px;
}

.sidebar {
    position: relative;
    z-index: 2;
    width: 30%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: first baseline;
    backdrop-filter: blur(2px);
    background: var(--sidebar-bg);
    border-radius: 36px;
}

/* TITLE */
.title-block {
    padding: 20px;
}

.title-block h1 {
    font-size: 36px;
    color: var(--primary-color);
}

.title-block h2 {
    font-size: large;
    color: var(--text-light);
}

.title-block .header a img {
    width: 40px;
    height: 40px;
    margin-top: 8px;
}

.title-block .header {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding-bottom: 12px;
}

/* CONTENT */
.sidebar-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-heading {
    color: var(--primary-color);
    font-size: 16px;
}


/* RESET BUTTON */
.reset-btn {
    visibility: hidden;
    float: right;
    background: transparent;
    border: none;
    cursor: pointer;
}

.reset-btn img {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    transition: rotate 0.3s;
}

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

.search-wrapper input {
    width: 100%;
    padding: 12px 35px 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    background: var(--background-black);
    color: var(--text-light);
}

.search-wrapper.active input {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.search-wrapper.active .clear-btn {
    display: block;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 15px;
    cursor: pointer;
    color: var(--primary-color);
    display: none;
}

.suggestions {
    max-height: 240px;
    overflow-y: auto;
    z-index: 3;
}

.suggestions-wrapper {
    position: absolute;
    visibility: hidden;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--background-black);
    border: 1px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding-bottom: 20px;
}

.suggestions div {
    padding: 10px;
    color: var(--text-light);
    cursor: pointer;
    background: var(--background-black);
}

.suggestions::-webkit-scrollbar {
    width: 8px;
    border-radius: 12px;
}

.suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 12px;
}

.latlon-section {
    display: flex;
}

.coord-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.coord-group label {
    font-size: 11px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.coord-group input {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--primary-color);
    background: var(--background-black);
    color: var(--text-light);
}

.coord-group:first-child input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.coord-group:last-child input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.calculate-btn {
    padding: 12px;
    border-radius: 50px;
    border: solid var(--primary-color);
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
}



.results-section {
    position: relative;
    z-index: 2;
    width: 30%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: first baseline;
}

.score-card {
    display: none;
    background: var(--primary-color);
    padding: 20px;
    margin: 12px 0;
    color: var(--text-dark);
    border-radius: 36px;
}

.score-card h3 {
    text-align: center;
    color: var(--text-dark);
}

.main-score {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
}

.feedback-row {
    display: flex;
    justify-content: flex-end;
    gap: 0px;
}

.feedback-btn {
    background: none;
    border: none;
    border-radius: 12px;
    padding: 0 6px;
    cursor: pointer;
    transition: 0.3s ease;
    opacity: 0.3;
}

.feedback-btn img {
    width: 20px;
    height: 20px;
}

.feedback-btn.active {
    opacity: 1;
}

@keyframes jumpUp {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(-8px); }
    60%  { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

@keyframes jumpDown {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(8px); }
    60%  { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

.feedback-btn.animate-up {
    animation: jumpUp 0.4s ease;
}

.feedback-btn.animate-down {
    animation: jumpDown 0.4s ease;
}

.breakdown {
    margin-top: 15px;
    font-size: 14px;
}

.score-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer {
    position: absolute;
    top: 0px;
    right: 12px;
    z-index: 5;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* MAP */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

.leaflet-container {
    background: var(--background-map);
}

/* Scale */
.leaflet-control-scale {
    padding: 3px 8px;
    /* margin-left: 30vw !important; */
}

.leaflet-control-scale-line {
    color: var(--primary-color) !important;
    text-shadow: var(--shadow-dark) 2px 2px 0px !important;
    font-size: 16px !important;
    font-family: monospace;
    border-bottom: solid var(--primary-color) !important;
    border-right: solid var(--primary-color) !important;
    border-left: solid var(--primary-color) !important;
    background: transparent !important;
    box-shadow: var(--shadow-dark) 2px 2px 0px !important;
}

/* Zoom */
.leaflet-control-zoom {
    background: var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: var(--secondary-color);
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-family: monospace;
    transition: background 0.3s, color 0.3s;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none;
}


.leaflet-control-zoom a.leaflet-disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
}

/* Recenter */
.recenter-control {
    width: 34px;
    height: 34px;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.recenter-control img {
    width: 16px;
    height: 16px;
    transition: filter 0.3s;
}

.lollipop-marker {
    position: relative;
    width: 20px;
    height: 40px;
    display: flex;
    justify-content: center;
}

.lollipop-stick {
    position: absolute;
    bottom: 0;
    width: 2px;
    height: 20px;
    border-radius: 0 0 10px 10px;
    background: var(--accent-pink);
}

.lollipop-head {
    position: absolute;
    bottom: 20px;
    width: 14px;
    height: 14px;
    background: var(--accent-pink);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-pink);
}

/* Mobile Responsive */
@media (max-width: 768px) {

    .container {
        padding: 0;
    }

    /* Sidebar becomes top bar */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        backdrop-filter: blur(4px);
        border-radius: 0;
    }

    .sidebar-content {
        flex-direction: column;
        gap: 8px;
        padding: 0;
        flex-wrap: wrap;
        width: 100%;
    }

    /* Search and coordinates */
    .search-section {
        flex: 1 1 auto;
        flex-direction: column;
        display: flex;
        gap: 8px;
    }

    .latlon-section {
        flex: 1 1 auto;
        display: flex;
    }

    .title-block {
        width: 100%;
        display: flex;
        padding: 0;
        align-items: center;
        gap: 8px;
    }

    .title-block h1 {
        font-size: 28px;
        color: var(--primary-color);
    }

    .title-block h2 {
        width: 100%;
        font-size: 17px;
        font-weight: lighter;
        color: var(--text-light);
        line-height: 90%;
    }

    .title-block .header a img {

        width: 24px;
        height: 24px;
        margin-top: 8px;
    }

    .title-block .header {
        /* width: 100%; */
        width: 35%;
        display: flex;
        padding-bottom: 0;
        align-items: baseline;
    }

    .reset-btn img {
        width: 16px;
        height: 16px;
    }

    .latlon-section {
        flex-wrap: wrap;
    }

    .coord-group {
        flex: 1 1 45%;
    }

    input,
    .calculate-btn {
        font-size: 14px;
        padding: 8px;
    }

    .calculate-btn {
        background: var(--primary-color);
        color: var(--secondary-color);
        flex: 1 1 100%;
        margin-top: 4px;
    }


    .results-section {
        position: absolute;
        bottom: 0px;
        z-index: 2;
        width: 100%;
        height: 30%;
        display: flex;
        flex-direction: column;
        justify-content: first baseline;
    }

    /* Move score card to bottom */
    .score-card {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        margin: 0;
        z-index: 10;
        padding: 16px;
    }

    .main-score {
        font-size: 32px;
        margin-bottom: -20px;
    }

    .breakdown {
        font-size: 12px;
    }

    /* Footer hidden or repositioned */
    .footer {
        display: none;
    }

    /* Map adjustments */
    #map {
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
    }

    .leaflet-control-scale {
        margin-top: 210px !important;
    }

    .leaflet-control-zoom {
        margin-top: 210px !important;
        transform: scale(0.9);
    }

    .recenter-control {
        transform: scale(0.9);
    }
}

@media (hover: hover) and (pointer: fine) {

    .leaflet-control-zoom a:hover {
        background: var(--primary-color);
        color: var(--text-dark);
    }

    .recenter-control:hover img {
        filter: brightness(0.15) saturate(0.2) contrast(1.1);
    }

    .recenter-control:hover {
        background: var(--primary-color);
    }

    .calculate-btn:hover {
        background: var(--primary-color);
        color: var(--secondary-color);
        transition: background 0.4s, color 0.4s;
    }

    .suggestions div:hover {
        background: var(--primary-color);
        color: var(--text-dark);
    }

    .reset-btn:hover img {
        rotate: 360deg;
    }

    .feedback-btn.active:hover {
        transform: scale(1);
        opacity: 1;
    }

    .feedback-btn:hover {
        transform: scale(1.1);
        opacity: 1;
    }

}