/**
 * FSTrack
 * Copyright (c) Violetech. All rights reserved.
 */

:root
{
    --sidebar-right-width: 500px;
    --sidebar-right-width-mobile: 200px;
    --button-base-color: #555;
}

@media (max-width: 768px)
{
    :root
    {
        --mobile-view: yes;
    }
}

@font-face
{
    font-family: Inter;
    src: url(/fonts/Inter.ttf);
}

html
{
    height: 100%;
    font-size: 12px;
}

*, *:before, *:after
{
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

body
{
    font-family: "Inter", Segoe UI, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
    margin: 0;
    height: 100%;
}

a, a:visited
{
    color: #aaa;
}

a:hover, a:visited:hover
{
    color: #ddd;
}

h1, h2, h3, h4
{
    margin: 0;
}

hr
{
    width: 100%;
    border: 0;
    border-bottom: 1px solid #555;
    margin-top: 10px;
    margin-bottom: 10px;
}



input[type=text],
input[type=email],
input[type=password]
{
    background-color: #333;
    padding: 5px;
    outline: 0;
    border: 1px solid #ffffff11;
    background: var(--button-base-color);
    background: linear-gradient(180deg, color-mix(in srgb, var(--button-base-color), #000 50%) 0%, color-mix(in srgb, var(--button-base-color), #000 30%) 100%);
    box-shadow: inset 0 0 4px #00000055;
    border: 1px solid color-mix(in srgb, var(--button-base-color), #000 50%);
    text-shadow: 0 -1px color-mix(in srgb, var(--button-base-color), #000 50%);
    border-radius: 5px;
    color: #fff;
    font-family: Inter, sans-serif;
    font-size: 1rem;
}

input::placeholder
{
    color: #aaaaaaaa;
}

input[type=text]:hover,
input[type=email]:hover,
input[type=password]:hover
{
    background-color: #7a6c6c;
}

button {
    font-family: Inter;
    font-size: 1rem;
    font-weight: 500;
    background: var(--button-base-color);
    background: linear-gradient(180deg, var(--button-base-color) 0%, color-mix(in srgb, var(--button-base-color), #000 30%) 100%);
    border: 1px solid color-mix(in srgb, var(--button-base-color), #000 30%);
    box-shadow: inset 0 1px color-mix(in srgb, var(--button-base-color), #fff 50%), 0 0 1px #00000055;
    padding: 0.5rem 1rem;
    outline: 0;
    border-radius: 3px;
    font-weight: 600;
    color: #eee;
    text-shadow: 0 -1px color-mix(in srgb, var(--button-base-color), #000 50%);
    cursor: pointer;

    &:hover {
        background: linear-gradient(180deg, color-mix(in srgb, var(--button-base-color), #fff 30%) 0%, var(--button-base-color) 100%);
        box-shadow: inset 0 1px color-mix(in srgb, var(--button-base-color), #fff 70%), 0 0 1px #00000055;
    }
    &:active {
        background: linear-gradient(180deg, color-mix(in srgb, var(--button-base-color), #000 50%) 0%, color-mix(in srgb, var(--button-base-color), #000 30%) 100%);
        box-shadow: inset 0 0 4px #00000055;
        border: 1px solid color-mix(in srgb, var(--button-base-color), #000 50%);
    }
    &:disabled {
        filter: saturate(0.5) opacity(0.4);
        cursor: default;
        pointer-events: none;
    }
}

button:hover
{
    background-color: #3f3f3f;
}

button:active
{
    background-color: #222;
}

button:disabled
{
    background-color: #3a3a3a;
    opacity: 0.5;
}

#login
{
    position: fixed;
    top: 100%;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background-color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
    transition: top 0.5s cubic-bezier(0.28, 0.04, 0, 1);
}

#login.show
{
    top: 0;
    pointer-events: initial;
}

#login form
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

main
{
    width: 100%;
    height: 100%;
}

#map
{
    width: calc(100% - var(--sidebar-right-width));
    height: 100%;
    z-index: 1;
    cursor: default;
    transition: width var(--transition-timing) cubic-bezier(0.28, 0.04, 0, 1);
}

@media (max-width: 768px)
{
    #map
    {
        width: calc(100% - var(--sidebar-right-width-mobile));
    }
}

#map.no-sidebar
{
    width: 100%;
}

#guest-message
{
    position: fixed;
    top: 0;
    padding: 3px;
    text-align: center;
    z-index: 5;
    background-color: #62378E;
    width: 100%;
}

#sidebar
{
    position: fixed;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100%;
    background-color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow: auto;
    transition: left var(--transition-timing) cubic-bezier(0.28, 0.04, 0, 1);
}

@media (max-width: 768px)
{
    #sidebar
    {
        height: 40%;
        top: 60%;
    }
}

#sidebar.opened
{
    left: 0;
}

#sidebar-info-image-link
{
    padding: 5px;
    width: 100%;
}

#sidebar-info-image-link #sidebar-info-image
{
    width: 100%;
}

.sidebar-content
{
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
}

.sidebar-content #sidebar-close-btn
{
    position: absolute;
    top: 3px;
    right: 3px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-content > div:not(.sidebar-divider),
.sidebar-content > span
{
    padding: 2px 7px 2px 7px;
}

.sidebar-divider
{
    margin: 5px 0 5px 0;
    padding: 5px 7px 5px 7px;
    text-align: center;
    background-color: #413846;
}

.sidebar-row
{
    display: flex;
    justify-content: space-between;
    gap: 3px;
    user-select: none;
}

.sidebar-row:last-child
{
    margin-bottom: 5px;
}

.sidebar-row > :last-child
{
    text-align: right;
}

.sidebar-panel
{
    display: flex;
    flex-direction: column;
}

#sidebar-info-callsign
{
    font-family: Inter;
    font-size: 24px;
    font-weight: 200;
    user-select: none;
}

.sidebar-info-name
{
    font-weight: 600;
}

#sidebar-history-link
{
    text-decoration: none;
    background-color: #222;
    padding: 5px;
    width: calc(100% + 14px);
    margin-left: -7px;
    margin-right: -7px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#sidebar-right
{
    position: fixed;
    top: 0;
    right: calc(var(--sidebar-right-width) * -1);
    width: var(--sidebar-right-width);
    height: 100%;
    background-color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow: auto;
    transition: right var(--transition-timing) cubic-bezier(0.28, 0.04, 0, 1);
}

@media (max-width: 768px)
{
    #sidebar-right
    {
        right: calc(var(--sidebar-right-width-mobile) * -1);
        width: var(--sidebar-right-width-mobile);
    }
}

#sidebar-right.opened
{
    right: 0;
}

#sidebar-right .sidebar-menu
{
    position: fixed;
    top: 0;
    right: 0;
    transition: right var(--transition-timing) cubic-bezier(0.28, 0.04, 0, 1);
    pointer-events: none;
}

#sidebar-right.opened .sidebar-menu
{
    right: var(--sidebar-right-width);
}

@media (max-width: 768px)
{
    #sidebar-right.opened .sidebar-menu
    {
        right: var(--sidebar-right-width-mobile);
    }
}

#sidebar-right .sidebar-menu .divider
{
    margin-top: 100px;
    pointer-events: none;
}

#sidebar-right .sidebar-menu button
{
    pointer-events: initial;
    border: 0;
    border-radius: 5px 0 0 5px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 5px;
    font-size: 18px;
    font-weight: 700;
}

#sidebar-right .sidebar-menu button:first-child
{
    border-radius: 0 0 0 5px;
}

#sidebar-right .sidebar-menu button.active
{
    --button-base-color: #252;
}

#sidebar-right-branding
{
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 10px;
    overflow: auto hidden;
    text-wrap: nowrap;
}

#sidebar-right-branding #logo
{
    width: 100%;
    max-width: 70px;
}

#sidebar-right #sidebar-right-branding-title
{
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

#sidebar-right #sidebar-right-user-info-details
{
    font-weight: 700;
    margin-bottom: 5px;
}

#sidebar-right #sidebar-right-user-info-buttons
{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 0.5rem;
}

#account-overlay
{
    position: fixed;
    top: 100%;
    width: 100%;
    height: 100%;
    background-color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
    transition: top 0.5s cubic-bezier(0.28, 0.04, 0, 1);
}

#account-overlay.show
{
    top: 0;
    pointer-events: initial;
}

#login #login-close-btn,
#account-overlay #account-overlay-close-btn
{
    position: absolute;
    top: 10px;
    right: 10px;
}

#account-overlay #account-info-container
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden auto;
}

.badge
{
    padding: 3px 5px 3px 5px;
    font-weight: 500;
    font-size: 0.9rem;
    background-color: #8F00FF;
    border-radius: 1rem;
    color: #fff;
}

.table-responsive
{
    overflow: auto hidden;
}

#aircraft-table th,
#aircraft-table td,
#latest-aircraft-table th,
#latest-aircraft-table td
{
    padding: 2px 5px 2px 5px;
    text-wrap: nowrap;
    text-align: center;
    vertical-align: middle;
}

#aircraft-table tr,
#latest-aircraft-table tr
{
    background-color: #222;
}

.aircraft-table-key
{
    padding: 3px;
    border-radius: 5px;
}

.aircraftTooltip
{
    position: fixed;
    background-color: rgba(0, 0, 0, 0.3);
    border: 0;
    border-radius: 5px;
    color: #000;
    font-family: Tahoma, Inter, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 3px;
    white-space: pre;
    text-shadow: -1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000;
    box-shadow: none;
    line-height: 1.1rem;
    pointer-events: none;
}

.aircraftTooltip::before,
.trackingTooltip::before
{
    display: none;
}

.aircraftTooltip::after
{
    position: absolute;
    top: 0;
    left: 0;
    content: attr(data-text);
    border: 0;
    border-radius: 0;
    color: #fff;
    font-family: Tahoma, Inter, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 3px;
    white-space: pre;
    line-height: 1.1rem;
    pointer-events: none;
}

.trackingTooltip
{
    position: fixed;
    background-color: rgba(0, 0, 0, 0);
    border: 0;
    border-radius: 0;
    color: #000;
    font-family: Tahoma, Inter, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 3px;
    white-space: pre;
    text-shadow: -1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000;
    box-shadow: none;
    line-height: 1.1rem;
    pointer-events: none;
}

.trackingTooltip::after
{
    position: absolute;
    top: 0;
    left: 0;
    content: attr(data-text);
    border: 0;
    border-radius: 0;
    color: #fff;
    font-family: Tahoma, Inter, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 3px;
    white-space: pre;
    line-height: 1.1rem;
    pointer-events: none;
}

.trackingMarker
{
    cursor: default;
}

.aircraftMarker
{
    filter: brightness(1);
}

.aircraftMarker.selected:not(.aircraftOnGrnd)
{
    filter: brightness(1.1);
}

.aircraftMarkerIdent
{
    border: 3px solid #ff0;
    border-radius: 50%;
    scale: 1;
    width: 50px;
    height: 50px;
    z-index: 500;
    animation-name: ident-anim;
    animation-iteration-count: infinite;
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.34, 0, 0.22, 1);
}

@keyframes ident-anim
{
    0%
    {
        scale: 0;
        border-width: 0;
        opacity: 0;
    }

    40%
    {
        opacity: 1;
        border-width: 3px;
    }

    80%
    {
        scale: 1.5;
        border-width: 0;
        opacity: 0;
    }

    100%
    {
        opacity: 0;
    }
}

.leaflet-tile-pane
{
    filter: brightness(0.55);
}

#map #altitude-graph
{
    position: absolute;
    bottom: 1rem;
    right: 0;
    width: 100%;
    max-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 2rem;
}

#map #altitude-graph > img
{
    height: 100%;
    max-height: 25px;
}

.leaflet-top.leaflet-right
{
    left: 5px !important;
    top: 50px !important;
}

.leaflet-control-zoom.leaflet-bar.leaflet-control
{
    margin-right: 5px;
    margin-top: 0;
}

.leaflet-control-attribution.leaflet-control-attribution.leaflet-control
{
    border-radius: 3px 0 0 0;
    font-size: 0.9rem;
}

.leaflet-bar
{
    border: 0 !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5) !important;
    border-radius: 5px !important;
}

.leaflet-bar a
{
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, sans-serif;
    font-size: 1.2rem;
    background: var(--button-base-color);
    background: linear-gradient(180deg, var(--button-base-color) 0%, color-mix(in srgb, var(--button-base-color), #000 30%) 100%);
    border: 1px solid color-mix(in srgb, var(--button-base-color), #000 30%);
    box-shadow: inset 0 1px color-mix(in srgb, var(--button-base-color), #fff 50%), 0 0 1px #00000055;
    padding: 0.5rem 1rem;
    outline: 0;
    border-radius: 3px;
    font-weight: 600;
    color: #eee;
    text-shadow: 0 -1px color-mix(in srgb, var(--button-base-color), #000 50%);
    cursor: pointer;

    &:hover {
        background: linear-gradient(180deg, color-mix(in srgb, var(--button-base-color), #fff 30%) 0%, var(--button-base-color) 100%);
        box-shadow: inset 0 1px color-mix(in srgb, var(--button-base-color), #fff 70%), 0 0 1px #00000055;
    }
    &:active {
        background: linear-gradient(180deg, color-mix(in srgb, var(--button-base-color), #000 50%) 0%, color-mix(in srgb, var(--button-base-color), #000 30%) 100%);
        box-shadow: inset 0 0 4px #00000055;
        border: 1px solid color-mix(in srgb, var(--button-base-color), #000 50%);
    }
    &:disabled {
        filter: saturate(0.5) opacity(0.4);
        cursor: default;
        pointer-events: none;
    }
}

.leaflet-interactive
{
    cursor: default;
}

.leaflet-touch .leaflet-bar a:first-child
{
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.leaflet-touch .leaflet-bar a:last-child
{
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

#sidebar-info-squawk-title-tooltip
{
    position: fixed;
    padding: 5px;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
    font-weight: 500;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s cubic-bezier(0.28, 0.04, 0, 1);
}