/* ================================
   El Picudo Rojo - Map Application Styles
   ================================ */

/* === BASE STYLES === */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* === LAYOUT STYLES === */
.container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.main {
    flex: 1;
    flex-wrap: wrap;
    flex-direction: column;
    overflow: auto;
    transition: flex 0.4s cubic-bezier(.4,0,.2,1);
    position: relative;
}

#map {
    height: 100vh;
    width: 100%;
}

/* === SIDEBAR STYLES === */
aside.sidebar {
    flex: 0;
    flex-direction: column;
    backdrop-filter: blur(30px) saturate(2);
    -webkit-backdrop-filter: blur(30px) saturate(2);
    padding-inline: 0;
    padding-block: 13px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    background: white;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 16px rgba(0,0,0,0.2);
    z-index: 1001;
    min-width: 0;
    max-width: 400px;
    opacity: 1;
    transition: flex 0.4s cubic-bezier(.4,0,.2,1), min-width 0.4s cubic-bezier(.4,0,.2,1);
    display: flex;
}

.container.active aside.sidebar {
    flex: 0.4;
    min-width: 300px;
}

.sidebar .card {
    border-radius: 1rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    margin: 24px 12px 24px 0;
    background: #fff;
}

.sidebar .card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 0.5rem;
}

.sidebar .table {
    margin-bottom: 0;
}

.sidebar h3 {
    margin-top: 30px;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}

.sidebar-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1976d2;
    margin: 20px 0 12px 0;
    padding: 0 18px 8px 18px;
    border-bottom: 3px solid #1976d2;
    letter-spacing: 0.5px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-left: 12px;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sidebar-content {
    margin-top: 18px;
    padding-left: 18px;
    padding-right: 18px;
}

#sidebar-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.sidebar-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin: 16px 18px 10px 18px;
    justify-content: space-between;
}

.sidebar-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s;
    cursor: pointer;
    flex: 1;
    min-width: 80px;
    white-space: normal;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
}

.sidebar-btn:hover {
    background: #1251a3;
}

.sidebar-btn.report-btn {
    background: #dc3545;
}

.sidebar-btn.report-btn:hover {
    background: #c82333;
}

.sidebar-status-label {
    color: #d32f2f;
    font-weight: 700;
}

/* === MAP CONTROLS === */
.lang-btn {
    background: #1976d2 !important;
    color: #fff !important;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, top 0.4s, right 0.4s;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
}

.lang-btn:hover {
    background: #1251a3 !important;
}

.container.active ~ .lang-btn {
    /* When sidebar is open, keep button in top-right corner */
    top: 10px;
    right: 10px;
}

.clear-btn {
    background: #dc3545 !important;
    color: #fff !important;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s;
    position: fixed;
    top: 64px;
    right: 10px;
    z-index: 1001;
}

.clear-btn:hover {
    background: #c82333 !important;
}

.show-points-btn {
    background: #1976d2 !important;
    color: #fff !important;
    border: none;
    border-radius: 5px;
    padding: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s;
    position: fixed;
    top: 10px;
    right: 60px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.show-points-btn:hover {
    background: #1251a3 !important;
}

/* === LEGEND STYLES === */
.info {
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}

.info h4 {
    margin: 0 0 5px;
    color: #777;
}

.legend {
    line-height: 18px;
}

.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
}

.legend .legend-item {
    margin-bottom: 4px;
}

/* === INSTRUCTIONS CARD === */
.instructions-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 2000;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.instructions-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 15px;
    text-align: center;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.instructions-close:hover {
    color: #333;
}

/* === MAP DISABLED STATE === */
.departments-disabled .leaflet-overlay-pane path { 
    pointer-events: none; 
}

/* === MOBILE RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    /* Mobile Layout Adjustments */
    .container {
        flex-direction: column;
    }
    
    .main {
        height: 100vh;
        width: 100%;
    }
    
    /* Mobile Sidebar - Bottom Sheet Style */
    aside.sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60vh;
        max-height: 500px;
        min-height: 300px;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1002;
        max-width: none;
        min-width: none;
        flex: none;
    }
    
    .container.active aside.sidebar {
        transform: translateY(0);
        flex: none;
        min-width: none;
    }
    
    /* Mobile Sidebar Content */
    .sidebar-title {
        font-size: 1.5rem;
        margin: 15px 0 10px 0;
        padding: 0 15px 8px 15px;
        text-align: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 8px;
        margin-left: 10px;
        margin-right: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    #sidebar-content {
        margin-top: 10px;
        padding: 0 20px;
        max-height: calc(60vh - 100px);
        overflow-y: auto;
    }
    
    #sidebar-content table {
        font-size: 0.9rem;
    }
    
    #sidebar-content td {
        padding: 8px 4px;
        word-break: break-word;
    }
    
    /* Mobile Buttons */
    .sidebar-links {
        margin: 10px 20px;
        gap: 4px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .sidebar-btn {
        padding: 12px 4px;
        font-size: 0.7rem;
        font-weight: 700;
        border-radius: 6px;
        min-height: 40px;
        flex: 1;
        min-width: 70px;
        white-space: normal;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Mobile Map Controls */
    .lang-btn {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
        background: #1976d2 !important;
        color: #fff !important;
    }
    
    .clear-btn {
        top: 64px;
        right: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
        background: #dc3545 !important;
        color: #fff !important;
    }
    
    .show-points-btn {
        top: 10px;
        right: 60px;
        padding: 8px;
        font-size: 1.1rem;
        min-height: 44px;
        min-width: 44px;
        width: 44px;
        height: 44px;
        background: #1976d2 !important;
        color: #fff !important;
    }
    
    /* Mobile Legend */
    .info {
        padding: 8px 12px;
        font-size: 12px;
        line-height: 14px;
        max-width: 200px;
    }
    
    .legend {
        line-height: 16px;
    }
    
    .legend i {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .legend .legend-item {
        margin-bottom: 3px;
        font-size: 11px;
    }
    
    /* Mobile Close Button */
    .close-btn {
        top: 15px;
        right: 20px;
        font-size: 1.8em;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile Instructions */
    .instructions-card {
        width: 90%;
        max-width: none;
        margin: 20px;
        padding: 15px;
    }
    
    .instructions-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .instructions-list li {
        margin-bottom: 10px;
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* === SMALL MOBILE OPTIMIZATIONS === */
@media (max-width: 480px) {
    /* Even smaller screens */
    aside.sidebar {
        height: 70vh;
        max-height: 600px;
    }
    
    .sidebar-title {
        font-size: 1.3rem;
        margin: 12px 0 8px 0;
        padding: 0 12px 6px 12px;
        text-align: center;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 6px;
        margin-left: 8px;
        margin-right: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    #sidebar-content {
        padding: 0 15px;
        max-height: calc(70vh - 80px);
    }
    
    #sidebar-content table {
        font-size: 0.85rem;
    }
    
    #sidebar-content td {
        padding: 6px 3px;
    }
    
    .sidebar-links {
        margin: 8px 15px;
        gap: 3px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .sidebar-btn {
        padding: 10px 3px;
        font-size: 0.65rem;
        font-weight: 700;
        min-height: 36px;
        flex: 1;
        min-width: 60px;
        white-space: normal;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Smaller map controls for very small screens */
    .lang-btn,
    .clear-btn,
    .show-points-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 40px;
        min-width: 40px;
    }
    
    .lang-btn {
        background: #1976d2 !important;
        color: #fff !important;
    }
    
    .clear-btn {
        top: 60px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 40px;
        min-width: 40px;
        background: #dc3545 !important;
        color: #fff !important;
    }
    
    .show-points-btn {
        top: 10px;
        right: 60px;
        padding: 6px;
        font-size: 1rem;
        min-height: 40px;
        min-width: 40px;
        width: 40px;
        height: 40px;
        background: #1976d2 !important;
        color: #fff !important;
    }
    
    /* Compact legend */
    .info {
        padding: 6px 8px;
        font-size: 11px;
        max-width: 180px;
    }
    
    .legend i {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }
    
    .legend .legend-item {
        font-size: 10px;
        margin-bottom: 2px;
    }
}

/* === TOUCH OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .sidebar-btn:hover,
    .lang-btn:hover,
    .clear-btn:hover,
    .show-points-btn:hover {
        /* Remove hover effects on touch devices */
        background: inherit;
    }
    
    /* Add active states for touch feedback */
    .sidebar-btn:active {
        background: #1251a3;
        transform: scale(0.98);
    }
    
    .sidebar-btn.report-btn:active {
        background: #c82333;
    }
    
    .lang-btn:active {
        background: #1251a3;
        transform: scale(0.95);
    }
    
    .clear-btn:active {
        background: #c82333 !important;
        transform: scale(0.95);
    }
    
    .show-points-btn:active {
        background: #1251a3;
        transform: scale(0.95);
    }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
    .container,
    aside.sidebar,
    .lang-btn,
    .clear-btn,
    .show-points-btn,
    .sidebar-btn {
        transition: none;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .sidebar-btn,
    .lang-btn,
    .clear-btn,
    .show-points-btn {
        border: 2px solid #000;
    }
    
    .info {
        background: white;
        border: 2px solid #000;
    }
} 

/* Palm Tree Icon Styles */
.palmtree-icon {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.palmtree-icon span {
    display: block !important;
    pointer-events: none !important;
    z-index: 1000 !important;
}

/* Ensure palm tree markers are always visible */
.leaflet-marker-icon.palmtree-icon {
    z-index: 1000 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hover effect for palm tree icons */
.palmtree-icon:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease-in-out;
}

/* Make sure the icon container is visible */
.leaflet-div-icon.palmtree-icon {
    background: transparent !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
} 