@charset "UTF-8";

/* Variables CSS */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --background-color: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Dimensions */
    --container-max-width: 1920px;
    --header-height: 90px;
    --footer-height: 200px;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--text-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-icon {
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header */
.header {
    background-color: var(--background-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-image {
    height: 80px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-subtitle {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
}

.logo a:hover .logo-text {
    color: var(--secondary-color);
}

.nav-main ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-main a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.nav-main a:hover,
.nav-main a.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.header-search {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    outline: none;
    width: 300px;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--secondary-color);
}

.search-btn {
    padding: 10px 16px;
    background-color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--primary-color);
}

/* Bouton Administration */
.header-admin {
    margin-left: 15px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.admin-btn:hover {
    background-color: var(--dark-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.admin-btn i {
    font-size: 16px;
}

.admin-text {
    font-size: 14px;
}

.admin-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #64748b;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-mobile {
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
}

.nav-mobile ul {
    list-style: none;
}

.nav-mobile li {
    margin-bottom: 10px;
}

.nav-mobile a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-mobile a:hover {
    background-color: var(--light-color);
}

/* Main content */
.main {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 40px 0;
    animation: fadeInUp 1s ease 0.4s both;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    animation: fadeInUp 1s ease 0.6s both;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.section-footer {
    text-align: center;
    margin-top: 40px;
}

/* Page header */
.page-header {
    background: linear-gradient(135deg, var(--light-color), #fff);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    margin-bottom: 20px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--secondary-color);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Grilles */
.panorama-grid,
.regions-grid,
.regions-grid-full,
.visites-grid {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.panorama-grid,
.visites-grid {
    grid-template-columns: repeat(3, 1fr);
}

.regions-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.regions-grid-full {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* Cards */
.panorama-card,
.region-card,
.region-card-full,
.visite-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.panorama-card:hover,
.region-card:hover,
.region-card-full:hover,
.visite-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.panorama-image,
.region-image,
.visite-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.panorama-image img,
.region-image img,
.visite-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.panorama-card:hover img,
.region-card:hover img,
.visite-card:hover img {
    transform: scale(1.05);
}

.panorama-overlay,
.region-overlay,
.visite-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.panorama-card:hover .panorama-overlay,
.region-card:hover .region-overlay,
.visite-card:hover .visite-overlay {
    opacity: 1;
}

.btn-view,
.btn-explore {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

/* Placeholders pour images panoramiques manquantes */
.panorama-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.panorama-placeholder.small {
    padding: 10px;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.placeholder-icon i {
    animation: pulse 2s ease-in-out infinite;
}

.placeholder-text .title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.placeholder-text .subtitle {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

.panorama-placeholder.small .placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0;
}

.panorama-placeholder.small .placeholder-text {
    display: none;
}

/* Animation pour l'icône */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.9;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

.btn-view:hover,
.btn-explore:hover {
    background-color: var(--primary-color);
    color: white;
}

.panorama-badge,
.region-count-badge,
.visite-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.panorama-info,
.region-info,
.region-content,
.visite-info {
    padding: 25px;
}

.panorama-title,
.region-name,
.visite-title {
    margin-bottom: 10px;
}

.panorama-title a,
.region-name a,
.visite-title a {
    color: var(--primary-color);
    font-weight: 500;
}

.panorama-location,
.visite-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.panorama-description,
.region-description,
.visite-description {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 15px;
}

.panorama-meta,
.visite-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.visite-meta {
    flex-wrap: wrap;
    gap: 10px;
}

.visite-region,
.visite-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Visite placeholder */
.visite-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

/* Virtual Tours Section */
.virtual-tours-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.virtual-tours-section .section-title {
    color: var(--primary-color);
}

/* Viewer */
.viewer-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff; /* Fond blanc pour les côtés */
}

.viewer-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    z-index: 100;
}

.viewer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    font-weight: 500;
}

.viewer-title h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.viewer-location {
    color: var(--text-light);
    font-size: 0.9rem;
}

.viewer-actions {
    display: flex;
    gap: 10px;
}

.panorama-viewer {
    flex: 1;
    position: relative;
    background: #000;
    margin: 0 20px; /* Espaces de 20px pour aérer */
    border-radius: 8px; /* Coins arrondis pour un effet plus moderne */
    overflow: hidden; /* Pour que le border-radius fonctionne avec le canvas */
}

.viewer-canvas {
    position: absolute; /* Changé de relative à absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Canvas Three.js en arrière-plan */
    pointer-events: auto; /* Permet l'interaction avec le panorama */
}

.viewer-canvas canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important; /* Canvas Three.js reste en arrière */
    pointer-events: auto !important; /* Canvas interactif pour la navigation */
}

.viewer-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 100;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.unified-controls {
    display: flex;
    align-items: stretch; /* Permet aux enfants de s'étirer verticalement */
    position: relative;
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-top-right-radius: 16px;
}

/* Onglet latéral (même couleur que l'onglet de la carte) */
.controls-tab {
    width: 45px;
    min-width: 45px;
    background: var(--primary-color);
    border-radius: 0 16px 0 0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    padding: 20px 0;
    gap: 10px;
    align-self: stretch; /* Prend toute la hauteur disponible */
}

.controls-tab:hover {
    background: #34495e;
}

.controls-tab-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    user-select: none;
}

.controls-tab-chevron {
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

/* État masqué - Effacement latéral vers la gauche */
.viewer-controls.collapsed {
    transform: translateX(-100%);
    left: 45px;
}

.viewer-controls.collapsed .controls-tab-chevron {
    transform: scaleX(-1);
}

/* Séparateur vertical entre les deux sections */
.controls-separator {
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 20%, 
        rgba(255, 255, 255, 0.3) 80%, 
        transparent 100%);
    margin: 0 5px;
}

.nav-cross {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-left: 15px;
}

.nav-middle {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Styles spécifiques pour chaque direction */
.nav-up, .nav-down {
    margin: 0 auto;
}

/* Carré 2x2 pour Home, Rotation, Zoom */
.square-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.square-row {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Boutons du carré avec couleurs individuelles */
.square-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

#reset-view {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

#auto-rotate {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 2px 8px rgba(67, 233, 123, 0.3);
}

#zoom-out {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.3);
}

#zoom-in {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    box-shadow: 0 2px 8px rgba(48, 207, 208, 0.3);
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.control-btn:hover::before {
    opacity: 1;
}

.control-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.control-btn.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.6);
    }
}

/* Responsive pour les contrôles */
@media (max-width: 768px) {
    .viewer-controls {
        bottom: 15px;
        left: 15px;
        gap: 12px;
    }
    
    .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}

/* Loading et états */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 5;
}

.spinner,
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-left: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ===================================
   Carte de localisation (Viewer)
   =================================== */
.location-map-container {
    position: absolute;
    top: 20px;
    right: 0;
    display: flex;
    align-items: flex-start; /* Aligner tous les éléments en haut */
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-map-container.collapsed {
    transform: translateX(calc(100% - 45px)); /* Laisse juste l'onglet visible */
}

/* Onglet vertical (toujours visible) */
.map-tab {
    width: 45px;
    background: var(--primary-color);
    border-radius: 0 0 0 12px; /* Arrondi uniquement en bas à gauche */
    box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Alignement en haut */
    padding: 15px 0;
    gap: 15px;
    flex-shrink: 0;
    height: 50%; /* Hauteur = 50% de la hauteur de la carte */
}

.map-toggle-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.map-toggle-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.map-toggle-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.map-tab-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: white;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    user-select: none;
}

/* Contenu de la carte */
.map-content {
    width: 400px; /* Largeur fixe pour stabilité */
    height: 500px; /* Hauteur fixe */
    background: white;
    border-radius: 0 0 0 12px; /* Arrondi uniquement en bas à gauche */
    box-shadow: -4px 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.location-map-container.collapsed .map-content {
    opacity: 0;
    pointer-events: none;
}

.map-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 0; /* Pas d'arrondi sur le header */
}

.map-header i {
    font-size: 18px;
    flex-shrink: 0;
}

.map-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-map {
    flex: 1;
    width: 100%;
    position: relative;
}

.location-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255,255,255,0.8);
}

/* Styles améliorés pour les contrôles Leaflet */
.location-map .leaflet-control-zoom {
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.location-map .leaflet-control-zoom a {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 18px;
    color: #333;
    background-color: white;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.location-map .leaflet-control-zoom a:hover {
    background-color: #f4f4f4;
    color: var(--primary-color);
}

.location-map .leaflet-control-zoom a:last-child {
    border-bottom: none;
}

.location-map .leaflet-control-layers {
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.location-map .leaflet-control-layers-toggle {
    width: 36px;
    height: 36px;
    background-size: 18px 18px;
}

.location-map .leaflet-control-layers-expanded {
    padding: 10px;
    background: white;
}

/* Responsive pour différentes tailles */
@media (max-width: 1400px) {
    .map-content {
        width: 350px;
        height: 450px;
    }
}

@media (max-width: 1200px) {
    .map-content {
        width: 320px;
        height: 420px;
    }
}

@media (max-width: 992px) {
    .map-content {
        width: 280px;
        height: 380px;
    }
    
    .map-tab {
        width: 40px;
    }
    
    .location-map-container.collapsed {
        transform: translateX(calc(100% - 40px));
    }
}

/* Plein écran */
/* Quand .panorama-viewer est en plein écran, ses enfants doivent rester visibles */
.panorama-viewer:-webkit-full-screen,
.panorama-viewer:-moz-full-screen,
.panorama-viewer:fullscreen {
    position: relative;
}

/* Canvas Three.js doit rester en arrière-plan en fullscreen */
.panorama-viewer:-webkit-full-screen .viewer-canvas,
.panorama-viewer:-moz-full-screen .viewer-canvas,
.panorama-viewer:fullscreen .viewer-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important; /* Canvas en arrière */
    pointer-events: auto !important;
}

.panorama-viewer:-webkit-full-screen .viewer-canvas canvas,
.panorama-viewer:-moz-full-screen .viewer-canvas canvas,
.panorama-viewer:fullscreen .viewer-canvas canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important; /* Canvas Three.js reste en arrière */
    pointer-events: auto !important;
}

.panorama-viewer:-webkit-full-screen .location-map-container,
.panorama-viewer:-moz-full-screen .location-map-container,
.panorama-viewer:fullscreen .location-map-container {
    position: absolute !important;
    top: 20px !important;
    right: 0 !important;
    z-index: 999999 !important; /* Z-index très élevé */
    pointer-events: auto !important;
}

.panorama-viewer:-webkit-full-screen .location-map-container.collapsed,
.panorama-viewer:-moz-full-screen .location-map-container.collapsed,
.panorama-viewer:fullscreen .location-map-container.collapsed {
    transform: translateX(calc(100% - 45px)) !important;
}

/* Contrôles du viewer en plein écran */
.panorama-viewer:-webkit-full-screen .viewer-controls,
.panorama-viewer:-moz-full-screen .viewer-controls,
.panorama-viewer:fullscreen .viewer-controls {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 999999 !important; /* Z-index très élevé */
    pointer-events: auto !important;
}

/* S'assurer que les boutons de contrôle sont cliquables */
.panorama-viewer:-webkit-full-screen .viewer-controls button,
.panorama-viewer:-moz-full-screen .viewer-controls button,
.panorama-viewer:fullscreen .viewer-controls button {
    position: relative !important;
    z-index: 1000000 !important;
    pointer-events: auto !important;
}

/* ===================================
   États vides
   =================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
}

.modal-body {
    padding: 30px;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 20px;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--secondary-color);
}

.footer-region-views {
    font-size: 0.85em;
    color: rgba(255,255,255,0.6);
    margin-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Responsive */
@media (max-width: 1550px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav-main,
    .header-search {
        display: none;
    }
    
    .header-admin .admin-text {
        display: none;
    }
    
    .admin-btn {
        padding: 10px;
        min-width: 44px;
        justify-content: center;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 1100px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .panorama-grid,
    .visites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .regions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .viewer-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .viewer-actions {
        order: -1;
    }
}

@media (max-width: 768px) {
    .panorama-grid,
    .visites-grid,
    .regions-grid {
        grid-template-columns: 1fr !important;
    }
    
    .location-map-container {
        top: 10px;
        right: 0;
    }
    
    .map-content {
        width: 280px;
        height: 320px;
    }
    
    .map-tab {
        width: 35px;
        padding: 12px 0;
    }
    
    .map-toggle-btn {
        width: 28px;
        height: 28px;
    }
    
    .map-tab-text {
        font-size: 11px;
        letter-spacing: 2px;
    }
    
    .location-map-container.collapsed {
        transform: translateX(calc(100% - 35px));
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================
   PANORAMA DESCRIPTION SECTION
   ========================================== */
.panorama-description-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 30px 0 40px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panorama-description-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.description-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.3s ease;
}

.description-toggle:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.description-toggle h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.description-toggle h3 i {
    color: var(--secondary-color);
    font-size: 1.4rem;
}

.toggle-btn {
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.3);
}

.toggle-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.4);
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.description-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease,
                padding 0.5s ease;
    opacity: 0;
    padding: 0 25px;
}

.description-content.visible {
    max-height: 800px;
    opacity: 1;
    padding: 25px;
}

.description-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #495057;
    margin-bottom: 20px;
    text-align: justify;
}

.description-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #6c757d;
}

.meta-item i {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.meta-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================
   RELATED PANORAMAS - CARD LAYOUT
   ========================================== */
.related-panoramas {
    margin: 50px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 45px;
    padding: 0 20px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-header h2 i {
    color: var(--secondary-color);
    font-size: 1.8rem;
}

.region-highlight {
    color: var(--secondary-color);
    font-weight: 800;
    position: relative;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
    margin: 0;
}

.panorama-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 0 15px;
}

.panorama-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.panorama-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.panorama-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
                                rgba(44, 62, 80, 0.85) 0%, 
                                rgba(52, 152, 219, 0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.panorama-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay i {
    color: white;
    font-size: 2.2rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.panorama-card:hover .card-overlay i {
    transform: scale(1);
}

.card-overlay span {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease 0.1s;
}

.panorama-card:hover .card-overlay span {
    transform: translateY(0);
    opacity: 1;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-title {
    margin: 0;
    font-size: 1.35rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.panorama-card:hover .card-title {
    color: var(--secondary-color);
}

.card-views {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.card-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #6c757d;
    text-align: justify;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.card-location i {
    color: var(--secondary-color);
    font-size: 1rem;
}

/* ==========================================
   RESPONSIVE - DESCRIPTION & CARDS
   ========================================== */
@media (max-width: 1200px) {
    .panorama-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .panorama-description-section {
        margin: 20px 0 30px 0;
        border-radius: 8px;
    }
    
    .description-toggle {
        padding: 15px 20px;
    }
    
    .description-toggle h3 {
        font-size: 1.1rem;
    }
    
    .toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .description-content.visible {
        padding: 20px;
    }
    
    .description-text {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .panorama-cards-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-content {
        padding: 18px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .description-toggle h3 {
        font-size: 1rem;
        gap: 8px;
    }
    
    .description-toggle h3 i {
        font-size: 1.2rem;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .section-header h2 i {
        font-size: 1.5rem;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-overlay i {
        font-size: 2rem;
    }
    
    .card-overlay span {
        font-size: 1rem;
    }
}

/* Stats Section (page r�gions) */
.stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    margin-top: 60px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Region Stats (dans les cards) */
.region-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.region-stats .stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.region-stats .stat i {
    color: var(--secondary-color);
}

.region-actions {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}
