/*
 * MAGASINS TOKÉS - Glass Design (iOS Style)
 * Design alternatif avec effet glassmorphism
 * Pour activer: remplacer styles.css par styles-glass.css dans index.html
 */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Header avec effet glass */
header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.contribute-btn {
    display: none;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .mobile-nav-content {
        max-width: 600px;
    }
}

#map-container {
    height: calc(100vh - 90px - 85px);
    width: 100%;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

/* Bouton de géolocalisation - Glass style */
.geolocate-btn {
    position: absolute;
    bottom: 130px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
                inset 0 1px 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.geolocate-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.geolocate-btn:active {
    transform: scale(0.95);
}

.geolocate-btn.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.geolocate-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@media (max-width: 768px) {
    .geolocate-btn {
        bottom: 90px;
        right: 15px;
        width: 52px;
        height: 52px;
    }

    .geolocate-icon {
        font-size: 24px;
    }
}

/* Panneaux glass */
.panel {
    position: fixed !important;
    bottom: -100%;
    left: 0;
    right: 0;
    top: auto !important;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto;
    max-height: calc(100vh - 100px);
    border-radius: 24px 24px 0 0;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: block !important;
}

.panel.mobile-active {
    bottom: 85px !important;
}

.panel.dragging {
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.25);
}

.panel-header {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(0, 0, 0, 0.85);
    padding: 16px 20px 12px 20px !important;
    cursor: default !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1;
}

.panel-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.panel-header h3 {
    margin: 8px 0 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.9);
}

.toggle-icon {
    display: none !important;
}

.panel-content {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.panel.collapsed .panel-content {
    display: block !important;
    max-height: calc(100vh - 180px) !important;
    padding: 16px !important;
}

/* Scrollbar glass style */
.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Info panel */
.info-panel {
    top: 20px;
    left: 20px;
    max-width: 280px;
    width: calc(100% - 40px);
}

.stats {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stats:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.stats strong {
    font-weight: 700;
    color: rgba(0, 0, 0, 0.85);
}

.stats .count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Recherche glass */
.search-input-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 14px 45px 14px 45px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.2);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    transition: all 0.2s;
}

.search-clear:hover {
    background: rgba(0, 0, 0, 0.25);
}

.search-clear.visible {
    display: flex;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 14px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-city {
    font-weight: 700;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 4px;
}

.result-count {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
}

.no-results {
    text-align: center;
    padding: 30px;
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
}

/* TOP 10 glass */
.top10-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.top10-item:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.top10-rank {
    font-weight: 800;
    font-size: 1.4rem;
    color: #667eea;
    min-width: 35px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top10-rank.gold { color: #FFD700; }
.top10-rank.silver { color: #C0C0C0; }
.top10-rank.bronze { color: #CD7F32; }

.top10-info {
    flex: 1;
    min-width: 0;
}

.top10-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top10-votes {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
}

/* Légende glass */
.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(3px);
}

.legend-item.disabled {
    opacity: 0.4;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.legend-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
}

/* Popups Leaflet glass */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 0;
}

.leaflet-popup-content {
    margin: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.modern-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.85);
}

/* Popups optimisées mobile */
@media (max-width: 768px) {
    .leaflet-popup-content-wrapper {
        max-width: 280px !important;
    }

    .leaflet-popup-content {
        margin: 12px !important;
        font-size: 13px;
        min-width: auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .leaflet-popup-content > div {
        min-width: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .leaflet-popup-content > div > div[style*="margin: -15px"],
    .leaflet-popup-content > div > div[style*="margin: -16px"] {
        margin: -12px -12px 12px -12px !important;
        padding: 14px 12px !important;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95)) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .leaflet-popup-content h3 {
        font-size: 14px !important;
        margin: 0 !important;
        word-wrap: break-word;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .leaflet-popup-content p {
        margin: 4px 0;
        font-size: 12px;
    }

    .leaflet-popup-content button {
        padding: 10px 20px !important;
        font-size: 13px !important;
        margin-top: 10px !important;
        width: auto !important;
        max-width: 85% !important;
        background: rgba(102, 126, 234, 0.9) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3) !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 12px !important;
        transition: all 0.3s !important;
    }

    .leaflet-popup-content button:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
    }

    .leaflet-popup-content div[style*="padding"] {
        padding: 10px !important;
        background: rgba(236, 240, 241, 0.6) !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .leaflet-popup-content * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 400px) {
    .leaflet-popup-content-wrapper {
        max-width: 260px !important;
    }

    .leaflet-popup-content {
        margin: 10px !important;
        font-size: 12px;
    }

    .leaflet-popup-content > div > div[style*="margin: -15px"],
    .leaflet-popup-content > div > div[style*="margin: -16px"] {
        margin: -10px -10px 10px -10px !important;
        padding: 12px 10px !important;
    }
}

/* Notifications glass */
.live-notifications-container {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 340px;
    z-index: 10000;
    pointer-events: none;
}

.live-notification {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 18px 22px;
    margin-bottom: 14px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.25);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s;
}

.live-notification:hover {
    transform: translateX(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.85);
}

.live-notification.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

.live-notification-icon {
    font-size: 36px;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.live-notification-content {
    flex: 1;
    min-width: 0;
}

.live-notification-store {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-notification-message {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 500;
}

.live-notification-time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 2px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
}

@media (max-width: 768px) {
    .live-notifications-container {
        display: none;
    }
}

/* Navigation mobile glass */
.mobile-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    z-index: 10001;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}

.mobile-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 14px;
    min-width: 72px;
    background: transparent;
}

.mobile-nav-link {
    text-decoration: none;
}

.mobile-nav-item:active {
    transform: scale(0.92);
}

.mobile-nav-item.active {
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-nav-icon {
    font-size: 26px;
    margin-bottom: 5px;
    transition: transform 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.15);
}

.mobile-nav-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
    transition: color 0.3s;
    letter-spacing: 0.3px;
}

.mobile-nav-item.active .mobile-nav-label {
    color: #667eea;
}

.mobile-nav-badge {
    position: absolute;
    top: 6px;
    right: 14px;
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* Overlay glass */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Petits écrans */
@media (max-width: 400px) {
    .mobile-nav-item {
        min-width: 60px;
        padding: 8px 12px;
    }

    .mobile-nav-icon {
        font-size: 22px;
    }

    .mobile-nav-label {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .mobile-nav-item {
        min-width: 54px;
        padding: 8px 8px;
    }

    .mobile-nav-icon {
        font-size: 20px;
    }

    .mobile-nav-label {
        font-size: 9px;
    }
}
