/* 🗺️ MAP POPUP 2.0 - DESIGNER #1 + RIO'S MASTERPIECE ✨ */
/* Version 10.1 - Complete Redesign */

/* ========================================
   CATEGORY COLOR SYSTEM 🎨
======================================== */

:root {
    /* Category Colors */
    --color-flagship: #3b82f6;      /* Blue - Premium attractions */
    --color-hiddenGems: #8b5cf6;    /* Purple - Hidden gems */
    --color-baths: #06b6d4;         /* Cyan - Thermal baths */
    --color-food: #f59e0b;          /* Orange - Restaurants */
    --color-nightlife: #ec4899;     /* Pink - Nightlife */
    --color-shopping: #10b981;      /* Green - Shopping */
    --color-nature: #84cc16;        /* Lime - Nature */
    
    /* Gradient Variations */
    --gradient-flagship: linear-gradient(135deg, #3b82f6, #2563eb);
    --gradient-hiddenGems: linear-gradient(135deg, #8b5cf6, #7c3aed);
    --gradient-baths: linear-gradient(135deg, #06b6d4, #0891b2);
    --gradient-food: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-nightlife: linear-gradient(135deg, #ec4899, #db2777);
    --gradient-shopping: linear-gradient(135deg, #10b981, #059669);
    --gradient-nature: linear-gradient(135deg, #84cc16, #65a30d);
}

/* ========================================
   GLASS MORPHISM POPUP 🪟
======================================== */

.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}

.attraction-popup {
    font-family: 'Heebo', sans-serif;
    animation: popupSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   IMAGE CONTAINER WITH OVERLAY 🖼️
======================================== */

.popup-image-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.popup-image-container:hover .popup-image {
    transform: scale(1.05);
}

/* Gradient Overlay for better text readability */
.popup-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
}

/* ========================================
   CATEGORY BADGE (Dynamic Color) 🏷️
======================================== */

.popup-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Category-specific badge colors */
.badge-flagship {
    background: var(--gradient-flagship);
}

.badge-hiddenGems {
    background: var(--gradient-hiddenGems);
}

.badge-baths {
    background: var(--gradient-baths);
}

.badge-food {
    background: var(--gradient-food);
}

.badge-nightlife {
    background: var(--gradient-nightlife);
}

.badge-shopping {
    background: var(--gradient-shopping);
}

.badge-nature {
    background: var(--gradient-nature);
}

/* ========================================
   TOP 30 BADGE ⭐ (STUNNING!)
======================================== */

.popup-top30-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    background-size: 200% 200%;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #78350f;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 
        0 4px 20px rgba(251, 191, 36, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.5) inset;
    z-index: 10;
    animation: goldenShine 3s ease-in-out infinite, badgePulse 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

@keyframes goldenShine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 4px 20px rgba(251, 191, 36, 0.6),
            0 0 0 2px rgba(255, 255, 255, 0.5) inset;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 8px 30px rgba(251, 191, 36, 0.8),
            0 0 0 3px rgba(255, 255, 255, 0.7) inset;
    }
}

.popup-top30-badge i {
    font-size: 1rem;
    animation: starSpin 4s linear infinite;
}

@keyframes starSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   CONTENT SECTION 📝
======================================== */

.popup-content {
    padding: 20px;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    line-height: 1.3;
    text-align: right;
}

.popup-district {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.popup-district i {
    color: #ef4444;
}

.popup-distance {
    margin-right: 8px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 12px;
    font-weight: 600;
    color: #1e40af;
    font-size: 0.75rem;
}

.popup-description {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 16px 0;
    text-align: right;
}

/* ========================================
   OPENING HOURS SECTION 🕐
======================================== */

.popup-opening-hours {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.08), 
        rgba(147, 197, 253, 0.08));
    border-right: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.opening-status {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.status-open {
    color: #059669;
}

.status-closed {
    color: #dc2626;
}

.status-closing-soon {
    color: #d97706;
}

.opening-hours-text {
    font-size: 0.875rem;
    color: #1e3a8a !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.opening-hours-text i {
    color: #1e40af !important;
}

/* ========================================
   DETAILS SECTION 💰👕
======================================== */

.popup-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.popup-detail-item {
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.popup-detail-item:hover {
    background: rgba(243, 244, 246, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popup-detail-item i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.popup-detail-item.cost i {
    color: #059669 !important;
}

.popup-detail-item.dress i {
    color: #1e40af !important;
}

.popup-detail-item span {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 600;
    text-align: right;
}

/* ========================================
   KROKO TIP SECTION 💡🐊
======================================== */

.popup-kroko-tip {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.1), 
        rgba(167, 243, 208, 0.1));
    border-right: 4px solid #10b981;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    animation: tipGlow 3s ease-in-out infinite;
}

@keyframes tipGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    }
}

.kroko-tip-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    animation: krokoWiggle 2s ease-in-out infinite;
}

@keyframes krokoWiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

.kroko-tip-content {
    flex: 1;
}

.kroko-tip-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 4px;
}

.kroko-tip-text {
    font-size: 0.875rem;
    color: #065f46;
    line-height: 1.5;
    text-align: right;
}

/* ========================================
   ACTION BUTTONS 🎯
======================================== */

.popup-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.popup-booking-btn,
.popup-maps-btn {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.popup-booking-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.popup-booking-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.popup-maps-btn {
    background: #ffffff !important;
    color: #1a73e8 !important;
    border: 2px solid #dadce0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-maps-btn:hover {
    background: #f1f3f4 !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #1a73e8 !important;
}

/* Button ripple effect */
.popup-booking-btn:active,
.popup-maps-btn:active {
    transform: translateY(-1px);
}

/* ========================================
   RESPONSIVE DESIGN 📱
======================================== */

@media (max-width: 480px) {
    .popup-image-container {
        height: 140px;
    }
    
    .popup-title {
        font-size: 1.25rem;
    }
    
    .popup-content {
        padding: 16px;
    }
    
    .popup-buttons {
        grid-template-columns: 1fr;
    }
    
    .popup-booking-btn,
    .popup-maps-btn {
        padding: 14px;
    }
}

/* ========================================
   DARK MODE SUPPORT 🌙
======================================== */

@media (prefers-color-scheme: dark) {
    .leaflet-popup-content-wrapper {
        background: rgba(17, 24, 39, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .popup-title {
        color: #f3f4f6;
    }
    
    .popup-description {
        color: #d1d5db;
    }
    
    .popup-detail-item {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(75, 85, 99, 0.5);
    }
    
    .popup-detail-item span {
        color: #e5e7eb;
    }
}
