body {
    padding: 0;
    margin: 0;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: -moz-none;
    -o-user-select: none;
    user-select: none;
    background-color: #f2efe9;
}

iframe {
    background-color: #f2efe9;
}

#text {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -o-user-select: text;
    user-select: text;
}

html,
body {
    height: 100%;
    width: 100%;
}

#map {
    width: 100%;
}

#loading,
.loading {
    width: 100%;
    height: 1px
}

#loading {
    position: fixed;
    top: 0px;
    z-index: 999;
    overflow: hidden;
    background-color: #000;
    margin: auto;
    border-radius: 10px;
    -o-border-radius: 10px;
    -ms-border-radius: 10px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px
}

.loading {
    background-color: #ffffffb8;
    margin-top: 0;
    margin-left: -100%;
    animation-name: bounce_loading;
    -o-animation-name: bounce_loading;
    -ms-animation-name: bounce_loading;
    -webkit-animation-name: bounce_loading;
    -moz-animation-name: bounce_loading;
    animation-duration: 1.5s;
    -o-animation-duration: 1.5s;
    -ms-animation-duration: 1.5s;
    -webkit-animation-duration: 1.5s;
    -moz-animation-duration: 1.5s;
    animation-iteration-count: infinite;
    -o-animation-iteration-count: infinite;
    -ms-animation-iteration-count: infinite;
    -webkit-animation-iteration-count: infinite;
    -moz-animation-iteration-count: infinite;
    animation-timing-function: linear;
    -o-animation-timing-function: linear;
    -ms-animation-timing-function: linear;
    -webkit-animation-timing-function: linear;
    -moz-animation-timing-function: linear
}

@keyframes bounce_loading {
    0% {
        margin-left: -100%
    }

    100% {
        margin-left: 100%
    }
}

@-o-keyframes bounce_loading {
    0% {
        margin-left: -100%
    }

    100% {
        margin-left: 100%
    }
}

@-ms-keyframes bounce_loading {
    0% {
        margin-left: -100%
    }

    100% {
        margin-left: 100%
    }
}

@-webkit-keyframes bounce_loading {
    0% {
        margin-left: -100%
    }

    100% {
        margin-left: 100%
    }
}

@-moz-keyframes bounce_loading {
    0% {
        margin-left: -100%
    }

    100% {
        margin-left: 100%
    }
}

button:focus {
    outline: 0;
}

#dw8,
#loader {
    width: 100%;
    height: 100%
}

#loader {
    position: absolute;
    z-index: 999;
    background-color: rgba(0, 0, 0, .3);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

#dw8 {
    position: fixed;
    top: 45%
}

.circle-loader {
    fill: transparent;
    stroke: #009688;
    stroke-width: 5;
    animation: dash 2s ease infinite, rotate 2s linear infinite
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 95;
        stroke-dashoffset: 0
    }

    50% {
        stroke-dasharray: 85, 95;
        stroke-dashoffset: -25
    }

    100% {
        stroke-dasharray: 85, 95;
        stroke-dashoffset: -93
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

#dbz_table span {
    font-size: 8px;
    font-weight: bold;
    color: black;
}

#dbz_legend {
    display: flex;
    width: 100%;
    direction: rtl;
    background: none;
    backdrop-filter: none;
    margin-bottom: 2px;
    opacity: 0.8;
}

.legend-item {
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    color: #222;
    position: relative;
    text-shadow: 0 0 4px #fff, 0 0 4px #fff;
}

.legend-item-content {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 20px;
}

.line-before,
.line-after {
    flex: 1 0 5px;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.line-after::after {
    display: none;
}

.legend-item:last-child .line-after::after {
    display: none;
}

/* Add gap between legend items */
.legend-item {
    padding-right: 4px;
}

.legend-item span {
    padding: 0 6px;
    white-space: nowrap;
}

.legend-item:last-child {
    border-left: none;
}

.maplibregl-ctrl-group button {
    width: 30px;
    height: 30px;
}

/* Modern Settings Modal */
#settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    z-index: 10000;
    border-radius: 24px;
    max-height: 85vh;
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    direction: rtl;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.settings-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: bold;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.settings-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.settings-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.settings-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 4px 0;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 0.95rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #007AFF;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Selects */
select.modern-select {
    appearance: none;
    padding: 10px 30px 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    margin-top: 5px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 10px;
    transition: border-color 0.2s;
}

select.modern-select:focus {
    border-color: #007AFF;
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 6px;
}

.badge-pro {
    background: rgba(255, 215, 0, 0.2);
    color: #b8860b;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.badge-new {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.badge-exp {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Radio Group */
.radio-group {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 10px;
    margin-top: 5px;
}

.radio-group label {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #666;
}

.radio-group input {
    display: none;
}

.radio-group input:checked+span {
    background: white;
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.radio-group span {
    display: block;
    padding: 6px;
    border-radius: 6px;
}

.footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Search Control Styles */
.search-ctrl-container {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

.geocoder-container {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10000;
    animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Override MapLibre Geocoder default styles to match our theme */
.maplibregl-ctrl-geocoder {
    width: 100% !important;
    max-width: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-family: inherit !important;
}

.maplibregl-ctrl-geocoder--input {
    height: 36px !important;
    padding: 6px 35px !important;
    direction: rtl !important;
    text-align: right !important;
}

.maplibregl-ctrl-geocoder--icon-search {
    left: auto !important;
    right: 12px !important;
    top: 10px !important;
}

.maplibregl-ctrl-geocoder--button {
    right: auto !important;
    left: 5px !important;
    top: 2px !important;
    background: none !important;
}

.maplibregl-ctrl-geocoder--icon-close {
    margin-top: 0 !important;
    margin-right: 0 !important;
}

.maplibregl-ctrl-geocoder .suggestions {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    margin-top: 5px !important;
    overflow: hidden !important;
}

.maplibregl-ctrl-geocoder .suggestions>li>a {
    padding: 10px 15px !important;
    text-align: right !important;
    direction: rtl !important;
}