:root {
  --primary-color: #558dba;
  --background-color: white;
  --secondary-background-color: white;
  --font-color: black;
  --card-color: darkslateblue;
  --invert-icon: invert(0%);
  --cards-shadow: 5px 5px 7px -3px rgba(60,60,60,0.3);
}

[data-theme="dark"] {
  --background-color: #171e26;
  --secondary-background-color: #10161d;
  --font-color: white;
  --card-color: darkslategrey;
  --invert-icon: invert(100%);
}

@font-face {
    font-family: 'Orbitron';
    src: url(/assets/fonts/Orbitron.ttf) format('truetype');
}

@font-face {
    font-family: 'Quicksand';
    src: url(/assets/fonts/Quicksand.ttf ) format('truetype');
}

body {
    font-family: Quicksand, sans-serif;
    margin: 0;
    background: var(--background-color);
    color: var(--font-color);
}
header {
    background: var(--secondary-background-color);
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(60,60,60,.2);
    margin-bottom: 20px;
}

header li {
    height: 3rem;
}
header img {
    max-height: 100%;
}
nav ul {
    list-style:none;
    margin: 0;
    padding: 0;
}

input[type=text], input[type=search], input[type=email], input[type=tel], select {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    box-sizing: border-box;
    background-color: var(--secondary-background-color);
    color: var(--font-color);
}

input:focus {
    outline: none;
}

button.btn {
    font-weight: bold;
    font-family: Quicksand, sans-serif;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: var(--primary-color);
    color: white;
}
input.search-input {
    flex-basis: 80%;
    border-radius: 4px 0 0 4px;
}

button.go{
    border-radius: 0 4px 4px 0;
    border-left: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-basis: 20%;
}

nav a {
    color: var(--font-color);
    text-decoration: none;
}

table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    text-align: left;
}

table {
    display: flex;
    flex-direction: column;
}

#captcha-error {
   color: red;
}

.main-nav {
    display: flex;
    justify-content: space-between;
}

.language {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.language-button {
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
}

.theme {
    display: flex;
    justify-content: center;
    flex-direction: column;
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
}
.settings {
    display: flex;
    gap: 0.5em;
}

.spinner {
    transition: all 0.2s;
}

.htmx-request .spinner {
    display:none;
    visibility: hidden;
    opacity: 0;
}
.go.htmx-request::after {
    transition-delay: 10s;
    content: "";
    width: 16px;
    height: 16px;
    border: 4px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
    margin: -4px;
}

#map {
    width: 100%;
    height: 400px;
    margin-bottom: 100px;
    box-shadow: var(--cards-shadow);
    border-radius: 10px;
}

#address-selected-map-parent {
    justify-content: center;
}

#address-selected-map {
    width: 80%;
    height: 200px;
    box-shadow: var(--cards-shadow);
    border-radius: 10px;
}


.map-title {
    display:flex;
}


.map-loader {
    border: 5px solid #f3f3f3;
    animation: spin 1s linear infinite;
    border-top: 5px solid #555;
    border-radius: 50%;
    width: 0.8em;
    height: 0.8em;
    min-width: 0.8em;
    min-height: 0.8em;
    margin-left: 0.5em;
    visibility: hidden;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}

.loader-container.htmx-request {
    display: flex;
}
.loader-container {
    height: 70vh;
    flex-direction: column;
    text-align: center;
    padding: 1rem;
    display: none;
    align-items: center;
    justify-content: center;
}
.loader {
    width: 150px;
    aspect-ratio: 1;
    display: grid;
    border: 10px solid #0000;
    border-radius: 50%;
    border-right-color: lightgrey;
    animation: l15 1s infinite linear;
}
.loader::before,
.loader::after {
    content: "";
    grid-area: 1/1;
    margin: 8px;
    border: inherit;
    border-radius: 50%;
    animation: l15 2s infinite;
}
.loader::after {
    margin: 28px;
    animation-duration: 3s;
}
@keyframes l15{
    100%{transform: rotate(1turn)}
}

#main.htmx-request {
    display: none;
}
.flex-centered.navigation {
    gap: 0.1rem;
}

.icon {
    margin-top: 0.2rem;
    display: inline-block;
    filter: var(--invert-icon);
}

.operator-icon {
    margin-top: 0.2rem;
    display: inline-block;
}

.flex-centered {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.check-offer {
    justify-content: center;
    max-height: 3.5rem;
    padding: 12px 20px;
    margin: 8px 0;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--cards-shadow);
    text-decoration: none;
    text-align: center;
    font-weight: bold;
}
.check-offer .icon {
    filter: invert(100%) sepia(0%) saturate(275%) hue-rotate(173deg) brightness(113%) contrast(101%);
}

.search-link {
    color: white;
}
.address-list {
    list-style:none;
    margin: 0;
    padding: 0;
    text-transform: capitalize;
}

.card-item {
    background: var(--secondary-background-color);
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    box-shadow: var(--cards-shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: solid 10px var(--primary-color);
}

.address-title {
    margin: 0;
}

.address-summary {
    word-break: break-all;
}

.address-footer {
    margin: 0;
    color: grey;
    font-style: italic;
    font-size: small;
}

.address-footer .building-id-footer {
    font-style: normal;
    font-weight: bold;
}

.building-icon {
    filter: invert(84%) sepia(6%) saturate(0%) hue-rotate(267deg) brightness(90%) contrast(89%);
}

.eligibility-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    list-style:none;
    margin: 0;
    padding: 0;
    text-transform: capitalize;
    flex-wrap: wrap;
}

.eligibility {
    gap: 1.5rem;
}

.eligibility-title {
    margin: 0;
    justify-content: center;
    text-align: center;
}


.eligibility-footer {
    margin: 0;
    color: grey;
    font-style: italic;
    font-size: small;
}

.eligibility-footer .building-id-footer {
    font-style: normal;
    font-weight: bold;
}

.operator-logo {
   height: 3.5rem;
}

.speed {
    display: flex;
    gap: 1rem;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.upload, .download {
    gap: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.price {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.price-amount {
    font-size: 3rem;
}
.price-amount-float {
    font-size: 1rem;
    padding-bottom: 0.5rem;
    align-content: end;
}
.price-unit {
    padding-top: 0.5rem;
}


.commitment {
    display: flex;
    gap: 1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.subscribe {
    margin-top: 2rem;
    margin-bottom: 2rem;
    flex-direction: column;
    gap: 0rem;
    box-shadow: var(--cards-shadow);
    padding: 1rem;
    border-radius: 8px;
    border: solid 2px var(--primary-color);
}

.subscribe-btn {
    width: 100%;
}


.provider {
    font-size: 1.2rem;
}

.subscribe-form {
    flex-basis: 50%;
}

.form-search {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-end;
    position: relative;
}

.title {
    font-family: Orbitron, sans-serif;
}

.card {
    color: white;
    display: flex;
    border-radius: 10px;
    box-shadow: var(--cards-shadow);
    flex-direction: column;
    background-image: url(/assets/images/card-bg.webp);
    background-size: cover;
    background-blend-mode: soft-light;
    background-color: var(--card-color);
    padding: 0.5rem;

}

.hint {
    flex: 1;
    order: -1;
    align-self: center;
    padding: 2rem;
    font-weight: bold;
}

.search {
    flex: 1;
    order: 1;
    padding: 2rem;
}

.card:before {
    content: "";
    border: 1px solid lightgrey;
    align-self: stretch;
    margin-right: 2rem;
    margin-left: 2rem;
}

.autocomplete {
    position: absolute;
    top: 50px;
    left: 0px;
    background: var(--secondary-background-color);
    border: 1px solid var(--primary-color);
    border-top: 0px;
    color: var(--font-color);
    width: 80%;
    border-radius: 0 0 4px 4px;
    z-index: 99;
}

.autocomplete:not(:has(:first-child)) {
  display: none;
}

.autocomplete-item {
    height: 32px;
    align-content: center;
    padding: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.autocomplete-item:hover, .autocomplete-active {
    background-color: var(--primary-color);
}

.maplibregl-map {
    font: inherit;
}
.maplibregl-popup {
    font-family: Quicksand, sans-serif;
    font-size: 0.75rem;
    color: black;
    --background-color: white;
    --secondary-background-color: white;
    --font-color: black;
    --card-color: darkslateblue;
    --invert-icon: invert(0%);
}

.maplibregl-popup-content {
    border-radius: 10px;
}

.maplibregl-popup-content .check-offer {
    max-height: 2.5rem;
}

.maplibregl-canvas {
    border-radius: 10px;
}

.maplibregl-ctrl-attrib {
    border-radius: 10px;
}

.container {
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.sr-only {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1;
    margin: 0 -1px -1px 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1;

}
@media (min-width: 768px) {
    .container {
        width: 750px;
    }

    .card {
        flex-direction: row;
    }

    .hint {
        order: 1
    }
    .search {
        order: -1
    }
}
@media (min-width: 992px) {
    .container {
        width: 970px;
    }

    .card-item {
        flex-direction: row;
        align-items: center;
    }

    .eligibility-list {
        flex-direction: row;
    }

    .eligibility {
        flex-direction: column;
        max-width: 16rem;
        min-width: 16rem;
    }

    .flex-centered.navigation {
        gap: 0.5rem;
    }

    .subscribe {
        flex-direction: row;
        padding: 3rem;
    }

}

.dark-only {
    display: none;
}

.light-only {
    display: inherit;
}

[data-theme="dark"] .dark-only {
    display: inherit;
}

[data-theme="dark"] .light-only {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #558dba;
        --background-color: #171e26;
        --secondary-background-color: #10161d;
        --font-color: white;
        --card-color: darkslategrey;
        --invert-icon: invert(100%);
        --cards-shadow: 5px 5px 7px -3px rgba(60,60,60,0.3);
    }

    [data-theme="light"] {
        --background-color: white;
        --secondary-background-color: white;
        --font-color: black;
        --card-color: darkslateblue;
        --invert-icon: invert(0%);
    }

    .dark-only {
        display: inherit;
    }

    .light-only {
        display: none;
    }
    [data-theme="light"] .dark-only {
        display: none;
    }

    [data-theme="light"] .light-only {
        display: inherit;
    }
}
