/* =====================================================
   ALIFE VIRTUAL WORLD MAP - SECOND LIFE STYLE
   Bootstrap 5 + Leaflet Layout
   ===================================================== */

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}

/* ===== SIDEBAR SECTION (LEFT) ===== */
.sidebar-section {
    background: linear-gradient(180deg, #1a1d29 0%, #0f1015 100%);
    color: #ffffff;
    height: 100vh;
    overflow-y: auto;
    border-right: 3px solid #667eea;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
}

.sidebar-content {
    padding: 20px;
}

/* Sidebar Header */
.sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    margin-bottom: 20px;
}

.sidebar-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.sidebar-header .text-muted {
    color: #a0a0a0 !important;
}

/* Section Titles */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

/* Search Section */
.search-section {
    margin-bottom: 25px;
}

.search-section .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 15px;
}

.search-section .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.search-section .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.search-result-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: translateX(5px);
}

.search-result-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 4px;
}

.search-result-item small {
    color: #a0a0a0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 25px;
}

.stat-card-mini {
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.stat-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.stat-card-mini .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card-mini .stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.stat-card-mini .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card-mini .stat-icon i {
    font-size: 2.5rem;
}

.stat-card-mini .stat-sublabel {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 8px;
}

.stat-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.pulse-badge {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Events Section */
.events-section {
    margin-bottom: 25px;
}

.events-list {
    max-height: 400px;
    overflow-y: auto;
}

.event-card {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.event-card:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.event-time {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 6px;
}

.event-time .badge {
    margin-left: 8px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.4; }
}

.event-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.event-location {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.event-location i {
    color: #667eea;
}

/* Quick Links Section */
.quick-links-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.3);
}

.quick-links-section .btn {
    font-size: 0.9rem;
    padding: 10px;
    font-weight: 600;
}

/* Scrollbar Styling for Sidebar */
.sidebar-section::-webkit-scrollbar,
.events-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 8px;
}

.sidebar-section::-webkit-scrollbar-track,
.events-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-section::-webkit-scrollbar-thumb,
.events-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.sidebar-section::-webkit-scrollbar-thumb:hover,
.events-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: #7c8ff0;
}

/* ===== MAP SECTION (RIGHT) ===== */
.map-section {
    height: 100vh;
    background: #0a0c10;
    position: relative;
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: #375A6D; /* Ocean blue for empty areas */
    z-index: 1;
}

/* Map Controls Overlay */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.map-legend {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 200px;
}

.map-legend h6 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #667eea;
}

.map-legend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.map-legend .legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #fff;
}

.map-legend .event-marker {
    background: #ff6b35;
    box-shadow: 0 0 10px #ff6b35;
    animation: pulse-marker 2s infinite;
}

.map-legend .region-marker {
    background: #4ecdc4;
    box-shadow: 0 0 10px #4ecdc4;
}

@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Leaflet Customizations */
.leaflet-container {
    background: #375A6D;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.leaflet-popup-content-wrapper {
    background: linear-gradient(135deg, #1a1d29 0%, #0f1015 100%);
    color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.leaflet-popup-content {
    margin: 0;
    font-size: 0.95rem;
}

.leaflet-popup-tip {
    background: #1a1d29;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

/* Region/Parcel Popup Styling */
.region-popup-content {
    min-width: 280px;
}

.region-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 12px 12px 0 0;
    margin: -1px -1px 0 -1px;
}

.region-popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.region-popup-header small {
    display: block;
    margin-top: 5px;
    opacity: 0.9;
    font-size: 0.85rem;
}

.region-popup-body {
    padding: 15px;
}

.region-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.region-info-row:last-child {
    border-bottom: none;
}

.region-info-row strong {
    color: #667eea;
}

.region-popup-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 12px 12px;
    margin: 0 -1px -1px -1px;
}

/* Beautiful Teleport/Visit Button */
.btn-teleport {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffd700 !important;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-teleport::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-teleport:hover::before {
    left: 100%;
}

.btn-teleport:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-teleport:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Parcel Popup Specific Styling */
.parcel-popup-container .region-popup-header {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.parcel-popup-container .btn-teleport {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
    color: #ffd700 !important;
    border-color: rgba(255, 215, 0, 0.3);
}

.parcel-popup-container .btn-teleport:hover {
    box-shadow: 0 6px 25px rgba(78, 205, 196, 0.6);
    color: #fff !important;
}

.leaflet-control-zoom a {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #fff !important;
    border-color: #667eea !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(102, 126, 234, 0.8) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    .sidebar-section {
        height: auto;
        max-height: 50vh;
    }
    
    .map-section {
        height: 50vh;
    }
    
    .events-list {
        max-height: 200px;
    }
}

@media (max-width: 576px) {
    .sidebar-header h1 {
        font-size: 1.4rem;
    }
    
    .stat-card-mini .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-card-mini .stat-icon i {
        font-size: 2rem;
    }
    
    .map-controls {
        top: 10px;
        right: 10px;
    }
    
    .map-legend {
        padding: 10px;
        min-width: 150px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-effect {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}
