/* style.css */

/* --- 1. MÀU SẮC CHỦ ĐẠO PI NETWORK --- */
.bg-pi-purple {
    background-color: #674198 !important;
}

.bg-pi-gradient {
    background: linear-gradient(90deg, #674198 0%, #8b5cf6 100%) !important;
}

.text-pi-purple {
    color: #674198;
}

.active-btn {
    background-color: #674198 !important;
    color: white !important;
    border-color: #674198 !important;
    box-shadow: 0 4px 10px rgba(103, 65, 152, 0.2);
}

/* --- 2. HỆ THỐNG MODAL & THÔNG BÁO (SWEETALERT2) --- */
.swal2-container {
    z-index: 3000 !important;
}

.swal2-popup {
    border-radius: 2.5rem !important;
    font-family: inherit;
}

.swal2-styled.swal2-confirm {
    background-color: #674198 !important;
    box-shadow: 0 4px 12px rgba(103, 65, 152, 0.3) !important;
}

/* --- 3. BẢN ĐỒ LEAFLET & TOÀN MÀN HÌNH --- */
.leaflet-container {
    z-index: 1 !important;
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.leaflet-popup-tip-container {
    display: none;
    /* Ẩn cái đuôi nhọn để nhìn hiện đại hơn */
}

/* Trạng thái toàn màn hình giả */
.map-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    /* Đảm bảo nó nằm trên cùng */
    border-radius: 0 !important;
}

.map-fullscreen-active #custom-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
}

/* Badge khoảng cách trong popup */
.distance-badge {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
    border: 1px solid #dbeafe;
}

/* --- 4. HIỆU ỨNG THẺ & TRANG TRÍ --- */
.review-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(103, 65, 152, 0.1);
}

/* Hiệu ứng Crown cho Shop số 1 */
#top-shops-container .bg-white:first-child {
    border-color: #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.15);
    position: relative;
}

#top-shops-container .bg-white:first-child::after {
    content: '👑';
    position: absolute;
    top: -10px;
    left: -5px;
    font-size: 16px;
}

/* --- 5. TIỆN ÍCH (SCROLLBAR) --- */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Hiệu ứng hào quang cho tia sét */
.tip-bolt {
    transition: all 0.3s ease;
    display: inline-block;
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.4));
}

.tip-bolt:hover {
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
    transform: scale(1.3) rotate(10deg);
}

/* Tooltip đơn giản */
.tip-bolt {
    position: relative;
}

.tip-bolt::after {
    content: "Tặng 0.5 Pi";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tip-bolt:hover::after {
    opacity: 1;
}

/* Màu Gradient cho thanh tiến trình */
.bg-pi-gradient {
    background: linear-gradient(90deg, #674198 0%, #9061d2 100%);
}

/* Hiệu ứng khi Rank thay đổi */
.rank-ambassador {
    background-color: #ef4444 !important;
}

/* Màu đỏ vương giả */
.rank-contributor {
    background-color: #8b5cf6 !important;
}

/* Màu tím đậm */
.rank-verified {
    background-color: #3b82f6 !important;
}

/* Màu xanh xác minh */

/* Ẩn scrollbar cho modal */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.animate__bounce {
    animation: bounce 1s;
}

/* Tạo hiệu ứng vòng tròn tỏa ra xung quanh chấm xanh */
@keyframes pulse-blue {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    70% {
        transform: scale(1.3);
        opacity: 0;
    }

    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

.leaflet-interactive[fill="#007AFF"] {
    animation: pulse-blue 2s infinite;
    transform-origin: center;
}


/* --- Hiệu ứng Floating Button Đóng góp Shop ---*/
.bg-pi-gradient {
    background: linear-gradient(135deg, #674198 0%, #8b5cf6 100%) !important;
}

button[onclick="toggleContribute()"] {
    box-shadow: 0 10px 25px -5px rgba(103, 65, 152, 0.5), 0 8px 10px -6px rgba(103, 65, 152, 0.5);
}

/* Điều chỉnh vị trí của logo Leaflet trong bản đồ */
/* .leaflet-bottom.leaflet-right {
    margin-bottom: 80px;
} */

/* Ngăn cuộn trang */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
    /* Giữ cố định chiều cao màn hình */
    touch-action: none;
    /* Ngăn cuộn trên thiết bị di động */
}

#visitor-counter {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#count-number {
    color: #e74c3c;
    /* Màu đỏ nổi bật */
}

/* Màu sắc cho trạng thái xác minh */
.status-verified {
    background-color: #d1fae5;
    /* Xanh lá nhạt */
    color: #065f46;
    border: 1px solid #10b981;
}

.status-unverified {
    background-color: #f3f4f6;
    /* Xám nhạt */
    color: #4b5563;
    border: 1px solid #d1d5db;
}

/* CSS bổ sung trong style.css */
.border-purple-100 {
    border-color: #e9d5ff !important;
}

.text-purple-700 {
    color: #674198 !important;
    /* Màu tím Pi chủ đạo */
}

/* Hiệu ứng nháy nhẹ cho badge đã xác thực để gây chú ý */
.bg-purple-50 {
    background-color: #f5f3ff !important;
    box-shadow: 0 0 5px rgba(103, 65, 152, 0.05);
}

/* CSS cho Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 5px;
}

.badge-pioneer {
    background: #e0e0e0;
    color: #666;
}

.badge-verified {
    background: #d1e9ff;
    color: #007aff;
}

.badge-contributor {
    background: #f3e5f5;
    color: #6b2d82;
}

.badge-ambassador {
    background: #fff9db;
    color: #f1c40f;
    border: 1px solid #f1c40f;
}

/* Hiệu ứng lấp lánh cho Ambassador (Tâm & Tín) */
.badge-ambassador {
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

/* Leader Board Trophy Style */
@keyframes trophy-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.fa-trophy {
    animation: trophy-bounce 3s infinite ease-in-out;
}

/* Style Rank Leader Board */
@keyframes pulse-slow {

    0%,
    100% {
        transform: scale(1.1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.25);
        opacity: 0;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s infinite ease-in-out;
}

html {
    /* Giữ chỗ cho thanh cuộn ngay cả khi nó không xuất hiện, 
     ngăn chặn việc giật khung hình khi mở Modal */
    scrollbar-gutter: stable;
}

/* --- 1. KHUNG CHỨA ẢNH (COLLAPSE) --- */
.img-collapse-container {
    max-height: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background-color: #f8fafc; /* Slate-50: sạch sẽ hơn */
    position: relative;
}

/* Khi ảnh hiển thị (thêm class thông qua JS) */
.img-collapse-container.show {
    max-height: 180px;
    opacity: 1;
}

/* --- 2. NÚT BẤM CAMERA (TỔNG HỢP & CỐ ĐỊNH) --- */
.toggle-image-btn {
    /* Cố định tuyệt đối so với khung Popup */
    position: absolute;
    right: 12px;
    top: 12px;
    
    /* Đảm bảo luôn nằm trên cùng của mọi lớp */
    z-index: 100 !important;
    
    /* Kích thước & Hình dáng */
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    
    /* Hiển thị */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #674198;
    border: 2px solid #ffffff;
    
    /* Đổ bóng sâu hơn để không bị lẫn vào ảnh */
    box-shadow: 0 4px 12px rgba(103, 65, 152, 0.3);
    
    /* Hiệu ứng mượt mà */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Hiệu ứng khi nhấn giữ (Chữ TÂM trong UX) */
.toggle-image-btn:active {
    transform: scale(0.9);
    background-color: #f1f5f9;
}

/* Khi ảnh đang mở (Active State) */
.toggle-image-btn.active {
    background: #674198;
    color: white;
    box-shadow: 0 4px 15px rgba(103, 65, 152, 0.5);
}

/* --- 3. ICON & HIỆU ỨNG XOAY --- */
.btn-rotate {
    transition: transform 0.4s ease;
    font-size: 14px;
}

.toggle-image-btn.active .btn-rotate {
    transform: rotate(180deg);
}

/* --- 4. CĂN CHỈNH NỘI DUNG PHÍA DƯỚI --- */
/* Đảm bảo không gian phía trên tiêu đề luôn thoáng */
.p-4.relative {
    padding-top: 24px !important;
    position: relative;
    background: white;
}

/* Đảm bảo các thành phần bên trong popup không bị xanh khi chạm */
.custom-shop-popup * {
    -webkit-tap-highlight-color: transparent;
}

/* Hiệu ứng thu nhỏ chung cho các nút chức năng khi nhấn */
.custom-shop-popup button:active i, 
.custom-shop-popup a:active i {
    transform: scale(0.85);
    transition: transform 0.1s ease;
}

/* Style Wallet on Popup */
.wallet-panel {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease-out;
    opacity: 0;
}

.wallet-panel.show {
    max-height: 300px; /* Độ cao tối đa của bảng ví */
    opacity: 1;
    margin-top: 10px;
    padding: 12px;
    border-top: 1px dashed #e2e8f0;
}

/* CSS nút đóng QR Ví */
[id^="wallet-panel-"] {
    z-index: 150 !important; /* Đảm bảo cao hơn .toggle-image-btn (đang là 100) */
}

[id^="wallet-panel-"] button {
    z-index: 160 !important; /* Nút X bên trong bảng ví phải cao nhất */
}