/* ── Panorama 360° — CCV ─────────────────────────────────── */

.ccv-panorama-gallery {
    --pano-radius: 8px;
    font-family: inherit;
    margin: 2rem 0;
}

/* Viewer principal */
.ccv-pano-viewer-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--pano-radius);
    overflow: hidden;
    background: #0a0a1a;
    box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

.ccv-pano-viewer {
    width: 100%;
    height: 100%;
}

/* Titre de la scène active */
.ccv-pano-scene-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 18px;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
}

/* Filigrane */
.ccv-pano-watermark {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 54px;
    height: auto;
    opacity: .55;
    pointer-events: none;
    z-index: 15;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}

@media (max-width: 600px) {
    .ccv-pano-watermark { width: 38px; top: 10px; right: 10px; }
}

/* ── Vignettes carrées ───────────────────────────────────── */
.ccv-pano-thumbs {
    --pano-thumb-size: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.ccv-pano-thumb {
    position: relative;
    width: var(--pano-thumb-size);
    height: var(--pano-thumb-size);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #1d3a6e, #1d6fa8) center / cover no-repeat;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}

.ccv-pano-thumb:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(29,111,168,.6);
    box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

.ccv-pano-thumb.is-active {
    border-color: #1d6fa8;
    box-shadow: 0 0 0 3px rgba(29,111,168,.35), 0 6px 16px rgba(0,0,0,.35);
    transform: scale(1.02);
}

.ccv-pano-thumb-title {
    display: block;
    width: 100%;
    padding: 6px 6px 5px;
    background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .ccv-pano-thumbs { --pano-thumb-size: 80px; }
}

/* ── Hotspots Pannellum ─────────────────────────────────── */

/* Conteneur injecté par Pannellum */
.pnlm-hotspot-base.ccv-pano-hotspot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(29, 111, 168, 0.85);
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, background .2s;
    margin-top: -18px;
    margin-left: -18px;
}

.pnlm-hotspot-base.ccv-pano-hotspot:hover {
    background: rgba(29, 63, 168, 0.95);
    transform: scale(1.2);
}

/* Flèche directionnelle dans le hotspot */
.pnlm-hotspot-base.ccv-pano-hotspot::after {
    content: '→';
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

/* Tooltip du hotspot */
.pnlm-hotspot-base.ccv-pano-hotspot .pnlm-tooltip {
    background: rgba(0,0,0,.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.pnlm-hotspot-base.ccv-pano-hotspot .pnlm-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,.75);
}

/* Spinner de chargement */
.ccv-pano-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,26,.7);
    z-index: 20;
    pointer-events: none;
    transition: opacity .3s;
}

.ccv-pano-loading.is-hidden { opacity: 0; pointer-events: none; }

.ccv-pano-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ccv-spin .8s linear infinite;
}

@keyframes ccv-spin { to { transform: rotate(360deg); } }

/* ── Modale de positionnement visuel ───────────────────── */

.ccv-pano-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ccv-pano-modal {
    background: #fff;
    border-radius: 10px;
    width: min(920px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.ccv-pano-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ccv-pano-modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1a202c;
}

.ccv-pano-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #718096;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.ccv-pano-modal-close:hover { background: #f7fafc; color: #2d3748; }

.ccv-pano-modal-viewer {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #0a0a1a;
}

.ccv-pano-modal-viewer > div {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

/* Barre d'outils modale */
.ccv-pano-modal-toolbar {
    padding: 12px 16px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ccv-pano-modal-coords {
    font-family: monospace;
    font-size: .82rem;
    color: #4a5568;
    background: #edf2f7;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: auto;
    white-space: nowrap;
}

.ccv-pano-modal-hint {
    font-size: .78rem;
    color: #718096;
    flex-basis: 100%;
    margin-top: 4px;
}

/* Bouton mode hotspot actif */
.ccv-pano-btn-hotspot.is-placing {
    background: #1d6fa8 !important;
    color: #fff !important;
    border-color: #1d6fa8 !important;
}

/* Hotspot de prévisualisation (en attente de confirmation) */
.pnlm-hotspot-base.ccv-pano-hotspot-preview {
    background: rgba(229, 62, 62, 0.9) !important;
    border-color: #fff !important;
    animation: ccv-pulse .7s ease infinite alternate;
}

.pnlm-hotspot-base.ccv-pano-hotspot-preview::after {
    content: '🎯' !important;
    font-size: 14px !important;
}

@keyframes ccv-pulse {
    from { transform: scale(1); box-shadow: 0 2px 10px rgba(229,62,62,.4); }
    to   { transform: scale(1.15); box-shadow: 0 4px 16px rgba(229,62,62,.7); }
}

/* Hotspot temporaire (placement) */
.ccv-pano-hs-temp {
    width: 28px;
    height: 28px;
    background: #e53e3e;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    animation: ccv-pulse .8s ease infinite alternate;
}
@keyframes ccv-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.2); }
}

/* Éditeur Gutenberg — placeholder */
.ccv-pano-editor-placeholder {
    border: 2px dashed #b0bec5;
    border-radius: var(--pano-radius);
    padding: 40px 24px;
    text-align: center;
    background: #f5f7fa;
    color: #546e7a;
}

.ccv-pano-editor-placeholder svg {
    display: block;
    margin: 0 auto 12px;
    opacity: .5;
}

/* Responsive */
@media (max-width: 600px) {
    .ccv-pano-viewer-wrap { aspect-ratio: 4 / 3; }
}
