/**
 * Kidzup - Map Tooltips Styles
 * 
 * Styles pour les tooltips enrichis des marqueurs Google Maps
 * 
 * @package Kidzup
 * @since 1.0.0
 */

/* ==========================================================================
   MAP TOOLTIP (InfoWindow enrichie)
   ========================================================================== */

.kidzup-map-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 300px;
    overflow: hidden;
}

/* Image du tooltip */
.tooltip-image {
    width: 100%;
    height: 160px;
    margin: -16px -16px 16px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.tooltip-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contenu du tooltip */
.tooltip-content {
    padding: 0;
}

/* Catégorie */
.tooltip-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 12px;
}

.tooltip-category i {
    font-size: 11px;
    color: #6c757d;
}

/* Titre */
.tooltip-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #2d3436;
}

/* Adresse */
.tooltip-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #636e72;
}

.tooltip-address i {
    color: #6c5ce7;
    margin-top: 2px;
    flex-shrink: 0;
}

.tooltip-address span {
    display: block;
    line-height: 1.4;
}

/* Note */
.tooltip-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.tooltip-stars {
    display: flex;
    gap: 2px;
}

.tooltip-stars i {
    font-size: 14px;
    color: #ffc107;
}

.tooltip-stars i.fa-light {
    color: #dfe6e9;
}

.rating-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

.review-count {
    font-size: 12px;
    color: #636e72;
}

/* CTA Button */
.tooltip-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #6c5ce7;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.tooltip-cta:hover {
    background: #5f4dd1;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.tooltip-cta i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.tooltip-cta:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   OVERRIDE GOOGLE MAPS INFOWINDOW DEFAULT STYLES
   ========================================================================== */

/* Container principal */
.gm-style .gm-style-iw-c {
    padding: 16px !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    max-width: 320px !important;
}

/* Contenu scrollable */
.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 400px !important;
}

/* Bouton de fermeture */
.gm-style .gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    opacity: 0.8 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
}

.gm-style .gm-ui-hover-effect:hover {
    opacity: 1 !important;
    background: #ffffff !important;
}

.gm-style .gm-ui-hover-effect > span {
    background-color: #2d3436 !important;
    width: 18px !important;
    height: 18px !important;
    margin: 7px !important;
}

/* Flèche du tooltip */
.gm-style .gm-style-iw-t::after {
    background: white !important;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   LOADING STATE MAP
   ========================================================================== */

.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #f8f9fa;
}

.map-loading-spinner {
    text-align: center;
}

.map-loading-spinner i {
    font-size: 3rem;
    color: #6c5ce7;
    animation: spin 1s linear infinite;
}

.map-loading-text {
    margin-top: 1rem;
    color: #636e72;
    font-size: 14px;
    font-weight: 500;
}

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

/* ==========================================================================
   NO RESULTS STATE
   ========================================================================== */

.map-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 12px;
}

.map-no-results p {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #636e72;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.map-no-results i {
    font-size: 2rem;
    color: #b2bec3;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
    .kidzup-map-tooltip {
        max-width: 280px;
    }
    
    .tooltip-image {
        height: 140px;
    }
    
    .tooltip-title {
        font-size: 16px;
    }
    
    .tooltip-cta {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .gm-style .gm-style-iw-c {
        max-width: 280px !important;
    }
}

/* ==========================================================================
   DARK MODE (optionnel)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .tooltip-category {
        background: #2d3436;
        color: #dfe6e9;
    }
    
    .tooltip-title {
        color: #dfe6e9;
    }
    
    .tooltip-address,
    .review-count {
        color: #b2bec3;
    }
    
    .rating-value {
        color: #dfe6e9;
    }
}

/* ==========================================================================
   ANIMATION D'ENTRÉE
   ========================================================================== */

.kidzup-map-tooltip {
    animation: tooltipFadeIn 0.3s ease-out;
}

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

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .gm-style .gm-ui-hover-effect {
        display: none !important;
    }
    
    .tooltip-cta {
        display: none !important;
    }
}
