* {
    margin: 0;
    padding: 0;
    font-family: 'Google Sans', sans-serif;
}

html, body, #map {
    height: 100vh;
    margin: 0;
    padding: 0;
    width: 100vw;
    overflow: hidden;
}
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-color: #ffffff;
}

.btn-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#side-menu {
    position: absolute;
    top: 0;
    left: -370px;
    width: 350px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#side-menu.open {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.logo-name {
    display: flex;
    align-items: center;
}
.logo-name span {
    font-weight: bold;
    font-size: 18px;
}
.logo {
    height: 30px;
    width: auto;
    margin-right: 10px;
}
.close-btn {
    background: none;
    border: none;
    font-size: 35px;
    padding: 10px;
    cursor: pointer;
}

.menu-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.layer-section {
    margin-bottom: 20px;
}

.layer-section summary {
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
    list-style: none;
    position: relative;
    display: flex;
    align-items: center;
}

.layer-section summary .arrow {
    margin-right: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    margin-left:32px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.layer-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.layer-item input[type="checkbox"],
.layer-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.layer-item input[type="checkbox"]::before,
.layer-item input[type="radio"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.layer-item input[type="checkbox"]:checked,
.layer-item input[type="radio"]:checked {
    background: #34c759;
}

.layer-item input[type="checkbox"]:checked::before,
.layer-item input[type="radio"]:checked::before {
    transform: translateX(20px);
}

.layer-item label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    flex: 1;
}

.menu-disclaimer {
    padding: 10px;
    font-size: 10px;
    color: #f97614 !important;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.menu-footer {
    padding: 10px;
    font-size: 12px;
    text-align: center;
    color: #999;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Additional styles from visorguadalupe */
.btn-menu {
    cursor: pointer;
}

.small {
    font-size: 0.9em;
}

.text-small {
    font-size: 10px;
}

.leaflet-container {
    background-color: #ffffff !important;
}

.text-gpe,
.leaflet-control-attribution.leaflet-control a:nth-child(1) {
    color: #f97614 !important;
}

   #map { 
        background-color: white !important;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 140px;
    right: 20px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease;
}

.loading-indicator img {
    display: block;
    width: 32px;
    height: 32px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (max-width: 768px) {
    .loading-indicator {
        top: auto;
        bottom: 80px;
        right: 10px;
    }
}

/* Warning Banner - Glassmorphism Design */
.warning-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 243, 205, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    z-index: 999;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11px;
    line-height: 1.5;
    color: #856404;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.warning-banner.hide {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.warning-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: #ff9800;
}

.warning-text {
    flex: 1;
}

.warning-text b {
    color: #663c00;
    font-weight: 600;
}

.warning-close-btn {
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    transition: color 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.warning-close-btn:hover {
    color: #663c00;
}

@media screen and (max-width: 768px) {
    .warning-banner {
        top: 10px;
        right: 10px;
        left: auto;
        width: 50%;
        max-width: none;
        font-size: 10px;
    }
}

/* Ficha Offcanvas Panels - Glassmorphism Design */
/* Bottom floating card for quick property info */
.ficha-bottom-card {
    width: 500px;
    max-width: 90%;
    height: auto;
    margin: 0 auto 20px auto;
    border-radius: 24px !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.offcanvas-bottom {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.offcanvas-bottom.show .ficha-bottom-card {
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ficha-bottom-card .offcanvas-header {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.ficha-bottom-card .offcanvas-body {
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.ficha-bottom-header {
    /* background: linear-gradient(135deg, rgba(59, 66, 87, 0.95) 0%, rgba(44, 52, 70, 0.95) 100%); */
    padding: 20px;
    margin: 12px 12px 0 12px;
    border-radius: 16px !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}

.ficha-bottom-body {
    padding: 14px 20px;
    background: transparent;
    text-align: center;
}

/* Left panel for detailed property information */
.ficha-details-panel {
    border-right: none;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    width: 400px;
    background: #ffffff;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.offcanvas-start {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.offcanvas-start.show .ficha-details-panel {
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ficha-details-header {
    background: linear-gradient(135deg, #3b4257 0%, #2c3446 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 20px;
}

.ficha-details-body {
    padding: 20px;
    background: #ffffff;
}

.offcanvas-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
}

.offcanvas-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.offcanvas-body {
    padding: 20px;
    background: transparent;
}

.table-info tr th {
    padding: 12px 8px 12px 0;
    background-color: transparent;
    font-weight: 600;
    color: #2c3446;
    font-size: 0.9rem;
    width: 45%;
}

.table-info tr td {
    padding: 12px 0;
    background-color: transparent;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.table-info tr {
    border-bottom: 1px solid rgba(44, 52, 70, 0.1);
}

.table-info tr:last-child {
    border-bottom: none;
}

.btn-light {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.2);
}

.offcanvas-body hr {
    margin: 12px 0;
    border-color: rgba(0, 0, 0, 0.08);
}

.text-small {
    font-size: 11px;
    line-height: 1.5;
    color: #889;
}

.offcanvas-bottom {
    background: transparent;
    border: none;
    height: auto;
    max-height: 350px;
}

.btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .ficha-bottom-card {
        width: calc(100% - 40px);
        max-width: none;
        margin: 0 20px 20px 20px;
        border-radius: 20px;
    }
    
    .ficha-details-panel {
        width: 90%;
    }
}

@media screen and (max-width: 480px) {
    .ficha-bottom-card {
        width: calc(100% - 20px);
        margin: 0 10px 10px 10px;
        border-radius: 16px;
    }
}


@media print {
    .leaflet-bottom.leaflet-right {
        display: none;
    }

    #map { 
        width: 10cm !important; 
        height: 10cm !important; 
    }

    @page {
        size: "US letter";
    }
}

/* Searchbox size adjustments */
.leaflet-control-searchbox {
    transform: scale(0.75);
    transform-origin: top left;
}

/* Symbology Legend Control - Right side floating */
.symbology-legend {
    position: fixed;
    bottom: 20px;
    right: 10px;
    max-width: 280px;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 998;
    padding: 0;
    display: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.symbology-legend.show {
    display: block;
    animation: fadeInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.symbology-legend.hide {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.symbology-close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    padding: 0;
    margin-left: auto;
    transition: color 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.symbology-close-btn:hover {
    color: #333;
}

.symbology-section {
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.symbology-section:last-child {
    margin-bottom: 0;
}

.symbology-title-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.symbology-title {
    font-weight: 600;
    font-size: 13px;
    color: #2c3446;
}

.symbology-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.symbology-item:last-child {
    margin-bottom: 0;
}

.symbology-color {
    width: 24px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.symbology-color.line {
    height: 3px;
    border: none;
    border-radius: 0;
    align-self: center;
}

.symbology-color.line-dashed {
    height: 3px;
    border: none;
    border-radius: 0;
    align-self: center;
    background: repeating-linear-gradient(
        to right,
        currentColor,
        currentColor 8px,
        transparent 8px,
        transparent 14px
    );
}

.symbology-color.circle {
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.symbology-color.star {
    width: 0;
    height: 0;
    border: none;
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
}

.symbology-color.star::before {
    content: "\2605";
    position: absolute;
    font-size: 24px;
    left: 0;
    top: -3px;
    color: currentColor;
}

.symbology-text {
    font-size: 12px;
    color: #555;
    line-height: 1.3;
}

@media screen and (max-width: 768px) {
    .symbology-legend {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        max-height: 40vh;
    }
}
