/* Generic css */

html, body {
    font-family: "Roboto Mono", monospace;
    font-weight: bold;
    margin: 0;
    padding: 0;
    height: 100%;
    min-width: 400px;
    color: white;
}

h1 {
    text-decoration: underline;
    margin: 0.3em 0;
}


p, h2, h6 {
    margin: 0.3em 0;
}

a {
    text-decoration: none;
}

head {
    display: none;
}

.center {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}



/* Main container */

.content {
    position: relative;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    background-image: url("images/background.svg");
    background-position: center;
    background-size: cover;
    z-index: 100;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 80%;
    height: 100%;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: rgba(7, 11, 20, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
    transform: translateX(-100%);
    transition: transform 0.28s ease-out, box-shadow 0.28s ease-out;
    visibility: hidden;
    opacity: 0;
    z-index: 900;
    pointer-events: none;
}

.sidebar__title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sidebar-nav__item {
    background: none;
    border: none;
    padding: 0.4rem 0;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-nav__item:hover,
.sidebar-nav__item:focus {
    color: #ffb703;
    transform: translateX(4px);
    outline: none;
}

.sidebar-nav__item--active {
    color: #ffb703;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 14, 0.55);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.28s ease-out;
    z-index: 850;
}

.sidebar-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(2, 6, 14, 0.25);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    pointer-events: auto;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.sidebar-toggle__icon {
    position: relative;
    width: 18px;
    height: 2px;
    background: white;
    transition: background 0.2s ease;
}

.sidebar-toggle__icon::before,
.sidebar-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: white;
    transition: transform 0.24s ease, top 0.24s ease;
}

.sidebar-toggle__icon::before {
    top: -6px;
}

.sidebar-toggle__icon::after {
    top: 6px;
}

.sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.sidebar--open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.sidebar-open .sidebar-toggle__icon {
    background: transparent;
}

.sidebar-open .sidebar-toggle__icon::before {
    top: 0;
    transform: rotate(45deg);
}

.sidebar-open .sidebar-toggle__icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* 1. App Bar */

.appbar {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
}

.appbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.appbar-section--left {
    align-items: flex-start;
    gap: 8px;
}

.appbar-section--right {
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-right: env(safe-area-inset-right, 0px);
}

.appbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.appbar-link--icon .appbar-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(2, 6, 14, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.appbar-link--icon:hover .appbar-icon,
.appbar-link--icon:focus .appbar-icon {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.appbar-icon img {
    display: block;
    width: 22px;
    height: 22px;
}

.appbar-icon--linkedin {
    background: #ffffff;
    color: #0a66c2;
    font-weight: 700;
    font-size: 18px;
    font-family: "Roboto Mono", monospace;
    letter-spacing: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-label {
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(2, 6, 14, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    align-self: center;
    pointer-events: auto;
}

/* 3. Visualization*/

.viz {
    position: relative;
    width: 100%;
    height: 100%;
}

#mapViz {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#mapViz svg {
    display: block;
    width: auto;
    height: auto;
}

.viz-overlay {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    pointer-events: none;
    z-index: 50;
}

.viz-overlay > * {
    pointer-events: auto;
}

.overlay-top {
    top: 0;
    width: 100%;
    max-width: 100vw;
    justify-content: space-between;
    align-items: flex-start;
}

.overlay-bottom {
    bottom: 16px;
    width: 100%;
    max-width: 100vw;
    padding: 0 calc(16px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    justify-content: flex-start;
    align-items: flex-end;
}

.country-tooltip {
    position: absolute;
    pointer-events: none;
    padding: 0.75rem 1rem;
    background: rgba(8, 12, 22, 0.85);
    color: #f5f5f5;
    border-radius: 8px;
    font-family: "Roboto Mono", monospace;
    font-weight: normal;
    font-size: 0.85rem;
    line-height: 1.3;
    max-width: 240px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    transition: opacity 0.18s ease-out;
    z-index: 1200;
}

.country-tooltip__title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.35rem;
    color: #ffe08a;
}

.country-tooltip__fact {
    display: block;
}

.country-tooltip__city {
    font-weight: bold;
    color: #ffe08a;
}

.country-tooltip__section-title {
    display: block;
    margin-top: 0.6rem;
    font-weight: bold;
    color: #9cd8ff;
}

.country-tooltip__lived-entry {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    opacity: 0.9;
}

.footer-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    padding-left: 0;
    pointer-events: auto;
}
