/* Stili per la modale del form immobile */
.nestup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.nestup-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.nestup-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nestup-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.nestup-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.nestup-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nestup-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.nestup-modal-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.nestup-modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.nestup-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.nestup-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nestup-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* Stili specifici per il form nella modale */
.nestup-modal .nestup-immobile-form-wrapper {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.nestup-modal .nestup-form-header {
    display: none; /* Nascondi l'header del form perché usiamo quello della modale */
}

.nestup-modal .nestup-btn-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .nestup-modal-content {
        width: 95%;
        margin: 2vh auto;
        max-height: 96vh;
    }
    
    .nestup-modal-header {
        padding: 16px 20px;
    }
    
    .nestup-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .nestup-modal-body {
        padding: 20px;
        max-height: calc(96vh - 70px);
    }
}

@media (max-width: 480px) {
    .nestup-modal-content {
        width: 98%;
        margin: 1vh auto;
        max-height: 98vh;
        border-radius: 4px;
    }
    
    .nestup-modal-header {
        padding: 12px 16px;
    }
    
    .nestup-modal-body {
        padding: 16px;
        max-height: calc(98vh - 60px);
    }
}

/* Accessibilità */
.nestup-modal:focus-within {
    outline: none;
}

.nestup-modal-content:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Prevenire lo scroll del body quando la modale è aperta */
body.nestup-modal-open {
    overflow: hidden;
}

/* Stili specifici per il canvas panoramico */
.carousel-360 .carousel-360-viewer {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.carousel-360 #panorama-canvas {
    border-radius: 8px;
    cursor: grab;
    transition: cursor 0.2s ease;
}

.carousel-360 #panorama-canvas:active {
    cursor: grabbing;
}

/* Overlay istruzioni panorama */
.carousel-360-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.carousel-360-instructions svg {
    animation: rotate360 3s linear infinite;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading panorama */
.panorama-loading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Controlli gallery 360 */
.carousel-360-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-360-auto {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-360-auto:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.carousel-360-auto:active {
    transform: scale(0.95);
}

/* Miglioramenti responsive per canvas */
@media (max-width: 768px) {
    .carousel-360 .carousel-360-viewer {
        height: 50vh;
    }
    
    .carousel-360-overlay {
        padding: 12px 16px;
    }
    
    .carousel-360-instructions div:first-child {
        font-size: 13px;
    }
    
    .carousel-360-instructions div:last-child {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .carousel-360 .carousel-360-viewer {
        height: 40vh;
    }
    
    .carousel-360-controls {
        gap: 8px;
    }
    
    .carousel-360-auto {
        padding: 6px;
    }
    
    .carousel-360-auto svg {
        width: 16px;
        height: 16px;
    }
}

/* Miglioramenti per la qualità del canvas su schermi ad alta densità */
.carousel-360 #panorama-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Stili per il focus accessibilità */
.carousel-360-auto:focus {
    outline: 2px solid #6f42c1;
    outline-offset: 2px;
}

/* Animazione per il pulsante auto-rotate attivo */
.carousel-360-auto[style*="rgba(111, 66, 193, 0.2)"] svg {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
} 