/* ========================================
   CSS Variables - Romantic Theme
   ======================================== */
:root {
    --color-primary: #ff6b9d;
    --color-primary-light: #ffb3d1;
    --color-primary-dark: #e8396e;
    --color-secondary: #ffd700;
    --color-accent: #ff8fab;
    
    --color-bg: #fff5f8;
    --color-bg-dark: #ffe6f0;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-lighter: #999;
    
    --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.1);
    --shadow-md: 0 4px 16px rgba(255, 107, 157, 0.15);
    --shadow-lg: 0 8px 32px rgba(255, 107, 157, 0.2);
    
    --border-radius: 20px;
    --border-radius-sm: 12px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Loading Screen
   ======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-bg) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.heart-loader {
    font-size: 4rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
}

.loading-content p {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--color-primary-dark);
    font-weight: 500;
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
}

.progress-indicator {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========================================
   Map Container
   ======================================== */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

/* Custom Mapbox Controls Styling */
.mapboxgl-ctrl-group {
    border-radius: var(--border-radius-sm) !important;
    box-shadow: var(--shadow-md) !important;
    border: none !important;
}

.mapboxgl-ctrl-group button {
    border-radius: var(--border-radius-sm) !important;
}

.mapboxgl-ctrl-group button:hover {
    background-color: var(--color-primary-light) !important;
}

/* ========================================
   Custom Markers
   ======================================== */
.custom-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 3px solid white;
    /* Optimisations GPU pour suivre la carte en temps réel */
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    /* Transition uniquement sur scale pour le hover, pas sur transform */
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.custom-marker:hover {
    transform: translate3d(0, 0, 0) scale(1.2);
    box-shadow: var(--shadow-lg);
}

.custom-marker.discovered {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #ffaa00 100%);
}

.custom-marker.hidden {
    opacity: 0.3;
    pointer-events: none;
}

.custom-marker.unlocked {
    animation: unlock 0.6s ease;
    opacity: 1 !important;
    pointer-events: all !important;
}

@keyframes unlock {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* ========================================
   Hint Overlay
   ======================================== */
.hint-overlay {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: var(--transition);
    pointer-events: none;
}

.hint-overlay.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}

.hint-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
}

.hint-icon {
    font-size: 1.5rem;
}

.hint-content p {
    margin: 0;
    color: var(--color-text);
    font-weight: 500;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.modal-close:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.modal-title {
    font-size: 2rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.5rem;
}

.modal-date {
    color: var(--color-text-light);
    font-size: 1rem;
}

.modal-body {
    padding: 0 2rem 2rem;
}

/* ========================================
   Modal Gallery
   ======================================== */
.modal-gallery {
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.gallery-item {
    width: 100%;
    display: none;
    animation: fadeIn 0.3s ease;
}

.gallery-item.active {
    display: block;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-sm);
}

.gallery-item video {
    max-height: 500px;
    object-fit: cover;
}

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

.gallery-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-lighter);
    cursor: pointer;
    transition: var(--transition-fast);
}

.gallery-indicator.active {
    background: var(--color-primary);
    transform: scale(1.3);
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text-light);
    text-align: center;
}

/* ========================================
   Modal Navigation
   ======================================== */
.modal-navigation {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 1rem;
    gap: 1rem;
}

.nav-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-primary);
    background: white;
    color: var(--color-primary);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.nav-btn:disabled:hover {
    background: white;
    color: var(--color-primary);
    box-shadow: none;
}

/* ========================================
   Celebration Overlay
   ======================================== */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 157, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.celebration:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    text-align: center;
    color: white;
    padding: 2rem;
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.celebration-content p {
    font-size: 1.3rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .header-subtitle {
        font-size: 0.9rem;
    }
    
    .progress-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .modal-content {
        margin: 0;
        border-radius: var(--border-radius-sm);
        max-height: 95vh;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-navigation {
        padding: 0 1rem 1rem;
    }
    
    .custom-marker {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .hint-overlay {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
    }
    
    .hint-overlay.hidden {
        transform: translateY(20px);
    }
    
    .hint-content {
        padding: 0.75rem 1.5rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.3rem;
    }
    
    .celebration-content h2 {
        font-size: 1.8rem;
    }
    
    .celebration-content p {
        font-size: 1rem;
    }
}

/* ========================================
   Smooth Scrollbar
   ======================================== */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--color-bg);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-primary-light);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}
