:root {
    --panel-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --button-bg: #007bff;
    --button-hover-bg: #0056b3;
    --button-text: #ffffff;
    --loader-bg: rgba(255, 255, 255, 0.8);
    --card-hover-shadow: rgba(0, 0, 0, 0.15);
    --sidebar-width-desktop: 350px;
    --sidebar-height-mobile: 50%;
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

#map {
    height: 100%;
    width: 100%;
    background-color: #f0f0f0;
    transition: transform 0.3s ease-out;
}

.leaflet-control-attribution {
    display: none;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: var(--loader-bg);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    font-size: 1.1em;
    color: var(--text-color);
    text-align: center;
}

.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #cb333b;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2001;
    animation: fadeInOut 5s forwards;
    text-align: center;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.info.legend {
    background: white;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    line-height: 22px;
    color: var(--text-color);
    font-size: 0.9em;
}

.info.legend h4 {
    margin: 0 0 8px;
    color: #555;
    font-size: 1.1em;
    font-weight: 600;
}

.info.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 10px;
    opacity: 0.85;
    border-radius: 3px;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width-desktop);
    height: 100%;
    background-color: transparent;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease-out;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.sidebar.active {
    transform: translateX(0);
}

@media (max-width: 767px) {
    .sidebar {
        background: transparent;
        width: 100%;
        height: var(--sidebar-height-mobile);
        bottom: 0;
        top: auto;
        transition: height 0.3s ease-out, transform 0.3s ease-out;
    }

    .sidebar.active {
        height: var(--sidebar-height-mobile);
        transform: translateY(0);
    }

    .leaflet-bottom.leaflet-left,
    .leaflet-bottom.leaflet-right {
        transition: bottom 0.3s ease-out, right 0.3s ease-out;
    }

    .sidebar-open .leaflet-bottom.leaflet-left,
    .sidebar-open .leaflet-bottom.leaflet-right {
        bottom: calc(10px + var(--sidebar-height-mobile));
    }
}

@media (min-width: 992px) {

    .sidebar-open .leaflet-top.leaflet-right,
    .sidebar-open .leaflet-bottom.leaflet-right {
        right: calc(10px + var(--sidebar-width-desktop));
    }
}

.leaflet-top.leaflet-right,
.leaflet-bottom.leaflet-right {
    transition: right 0.3s ease-out;
}

@media (max-width: 600px) {
    .controls-panel {
        top: auto;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 40vh;
    }
}

.card {
    background-color: var(--panel-bg);
    border-radius: 12px;
    margin: 15px;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: transform 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--card-hover-shadow);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-weight: 700;
    margin-block-start: 0%;
}

p.f-local,
p.f-start,
p.f-nature,
p.f-location,
.f-status,
.f-meteo,
.f-extra {
    font-size: 1.05em;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.5;
    margin-block-start: 0%;
    margin-left: 1rem;
    margin-right: 1rem;
}

.f-danger {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1.05em;
    color: var(--text-color);
    line-height: 1.5;
}

.f-danger li {
    display: inline;
    white-space: nowrap;
}

.assets {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}

.assets-icon {
    width: 32px;
    height: 32px;
    margin: 0 8px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.assets-nr {
    font-size: 1.2em;
    font-weight: 600;
    color: #495057;
    margin-right: 20px;
}

canvas#myChart {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dot {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: no-repeat 50%/60%;
    background-position: center;
}

#status {
    border-left: 2px solid #bdbdbd;
}

.status-hour {
    margin-block-start: 0%;
    margin-block-end: 0%;
    margin-left: 1em;
}

.status-label {
    margin-block-start: 0%;
    margin-block-end: 1em;
    margin-left: 1em;
}

.dot.status-99,
.dot.status-important,
.dot.status-99-r,
.dot.status-5,
.dot.status-7,
.dot.status-8 {
    background-image: url("../img/ico_fire.svg");
}

.dot.status-3,
.dot.status-4 {
    background-image: url("../img/ico_alarm.svg");
}

.dot.status-6,
.dot.status-10 {
    background-image: url("../img/ico_pointer.svg");
}

.dot.status-9 {
    background-image: url("../img/ico_watch.svg");
}

.dot.status-11,
.dot.status-12 {
    background-image: url("../img/ico_fake.svg");
}

.dot.status-99,
.dot.status-important {
    background-color: #ff410c;
}

.dot.status-99-r {
    background-color: #0c5dff;
}

.dot.status-3,
.dot.status-5,
.dot.status-6 {
    background-color: #b81e1f;
}

.dot.status-4 {
    background-color: #ff6e02;
}

.dot.status-7,
.dot.status-9 {
    background-color: #65c4ed;
}

.dot.status-8 {
    background-color: #8e7e7d;
}

.dot.status-10 {
    background-color: #6abf59;
}

.dot.status-11,
.dot.status-12 {
    background-color: #bdbdbd;
}

.dot.dotInfo,
.dot.timelineDot {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    float: left;
    margin-left: -13px;
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.extra {
    display: none;
}

.extra.active {
    display: block;
}

.danger {
    display: none;
}

.danger.active {
    display: block;
}

.f-location a,
.f-local a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.f-location a:hover,
.f-local a:hover {
    color: #0056b3;
}

.fire-status {
    margin: 0 0 1rem;
    color: #fff;
    text-transform: uppercase;
    padding-inline-start: 0px;
    margin-block-start: 0%;
    margin-block-end: 0%;
}

.fire-status li {
    padding: 10px 6px;
    border-radius: 3px;
    transition: width 0.3s;
}

.fire-status li:not(:first-child) {
    margin-left: 2px;
}

.fire-status li.status-max {
    background-color: #711313;
}

.fire-status li.status-vhigh {
    background-color: #b81e1f;
}

.fire-status li.status-high {
    background-color: #ff6e02;
}

.fire-status li.status-mod {
    background-color: #ffb202;
}

.fire-status li.status-min {
    background-color: #6abf59;
}

.fire-status li.active {
    width: 100%;
}

.fire-status li.active:before {
    content: attr(data-status);
}