@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: 1200px;
    --header-height: 70px;
    --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);
}

.logo i {
    font-size: 28px;
    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;
}

.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;
}

.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 {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.panorama-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 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 {
    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 {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.panorama-image,
.region-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.panorama-image img,
.region-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.panorama-card:hover img,
.region-card:hover img {
    transform: scale(1.05);
}

.panorama-overlay,
.region-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 {
    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 {
    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 {
    padding: 25px;
}

.panorama-title,
.region-name {
    margin-bottom: 10px;
}

.panorama-title a,
.region-name a {
    color: var(--primary-color);
    font-weight: 500;
}

.panorama-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.panorama-description,
.region-description {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 15px;
}

.panorama-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;
}

/* 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 {
    width: 100%;
    height: 100%;
}

.viewer-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.control-group {
    display: flex;
    gap: 5px;
    background: rgba(0,0,0,0.7);
    border-radius: 25px;
    padding: 5px;
}

/* Groupe Home + Zoom */
.home-zoom-controls {
    border-radius: 25px;
}

/* Contrôles de navigation directionnelle en croix */
.navigation-controls {
    background: rgba(0,0,0,0.7) !important;
    border-radius: 10px !important;
    padding: 8px !important;
}

.nav-cross {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-middle {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Groupe auto-rotation */
.auto-controls {
    border-radius: 25px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.control-btn:hover {
    background: white;
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--secondary-color);
    color: white;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.nav-btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Styles spécifiques pour chaque direction */
.nav-up, .nav-down {
    margin: 0 auto;
}

/* Styles spécifiques pour chaque direction */
.nav-up, .nav-down {
    margin: 0 auto;
}

.zoom-controls, .auto-controls {
    flex-direction: column;
}

.zoom-controls .control-btn,
.auto-controls .control-btn {
    width: 45px;
    height: 45px;
    margin: 2px 0;
}

/* 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;
}

.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-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: 768px) {
    .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;
    }
    
    .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,
    .regions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .viewer-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .viewer-actions {
        order: -1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}