/* Map Modal Styles */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.map-modal-content {
    width: 90%;
    height: 85%;
    max-width: 1400px;
    background: #0f1523;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #e6edf3;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #00e5ff;
    transform: rotate(90deg);
}

.map-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.map-header h2 {
    margin: 0;
    color: #00e5ff;
    font-size: 1.8rem;
}

.map-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    overflow: hidden;
}

.map-container {
    height: 100%;
    position: relative;
    background: #1a1f2e;
}

/* Leaflet overrides */
.map-container .leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.7);
    color: #9ba5b4;
}

.map-container .leaflet-popup-content-wrapper {
    background: #0f1523;
    color: #e6edf3;
    border: 1px solid rgba(124, 77, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.map-container .leaflet-popup-tip {
    background: #0f1523;
}

/* Custom markers */
.custom-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.marker-icon.highlighted .custom-marker {
    transform: scale(1.2);
    box-shadow: 0 0 20px currentColor;
    border-color: currentColor;
}

/* Popup content */
.map-popup {
    min-width: 250px;
    max-width: 300px;
}

.map-popup img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.map-popup h3 {
    margin: 10px 0;
    color: #00e5ff;
    font-size: 1.2rem;
}

.map-popup p {
    margin: 8px 0;
    color: #9ba5b4;
    font-size: 0.95rem;
    line-height: 1.5;
}

.popup-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #9ba5b4;
}

.popup-meta .day {
    color: #7c4dff;
    font-weight: 600;
}

.popup-meta .time {
    color: #00e5ff;
}

/* Places sidebar */
.places-sidebar {
    background: rgba(255, 255, 255, 0.03);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    padding: 20px;
}

.places-sidebar::-webkit-scrollbar {
    width: 6px;
}

.places-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.places-sidebar::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.5);
    border-radius: 3px;
}

.day-section {
    margin-bottom: 30px;
}

.day-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid currentColor;
}

.places-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.place-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.place-card:hover {
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateX(-5px);
}

.place-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.place-info {
    padding: 12px;
}

.place-info h4 {
    margin: 0 0 8px 0;
    color: #e6edf3;
    font-size: 1.1rem;
}

.place-info .time {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 229, 255, 0.2);
    color: #00e5ff;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.place-info p {
    margin: 0;
    color: #9ba5b4;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Loader */
.map-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.map-loader .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00e5ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.map-loader p {
    color: #9ba5b4;
    font-size: 1.1rem;
}

/* Messages */
.no-places-message,
.map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
}

.no-places-message p,
.map-error p {
    color: #9ba5b4;
    font-size: 1.1rem;
    margin: 10px 0;
}

.map-error button {
    margin-top: 20px;
    padding: 10px 24px;
    background: linear-gradient(90deg, #7c4dff, #00e5ff);
    color: #000;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-error button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .map-body {
        grid-template-columns: 1fr;
    }
    
    .places-sidebar {
        position: absolute;
        right: 0;
        top: 0;
        height: 100%;
        width: 320px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .places-sidebar.show {
        transform: translateX(0);
    }
}

@media (max-width: 640px) {
    .map-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .places-sidebar {
        width: 100%;
    }
}