:root {
    --bg-color: #0F52BA;
    --text-color: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Outfit', sans-serif;
    --accordion-bg: #fff;
    --accordion-text: #333;
    --accent-blue: #4facfe;
    --accent-cyan: #00f2fe;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.background-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #1a237e 0%, #0d47a1 100%);
}

.main-container {
    display: flex;
    width: 95%;
    /* Slightly wider */
    max-width: 1200px;
    height: 90vh;
    /* Taller */
    /* REMOVED BACKGROUND, BORDER, SHADOW */
    position: relative;
    transition: all 0.5s ease;
}

/* LEFT PANEL: Upload / Preview */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: all 0.5s ease;
    position: relative;
    z-index: 10;
}

/* RIGHT PANEL: Modal Version now */
.modal-right {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 25px;
    overflow-y: auto;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* HEADER SECTION (Replaces Slider) */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    text-align: center;
}

.header-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    /* Removed filter and animation */
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

.header-info h2 {
    margin: 0;
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-info p {
    margin: 8px 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Drop Zone */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
}

.drop-zone:hover .drop-icon {
    transform: scale(1.1);
    color: #fff;
    filter: drop-shadow(0 0 25px var(--accent-cyan));
}

.eye-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    /* Bubble Effect */
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.drop-icon {
    font-size: 70px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.4s ease;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.1);
    animation: pulse 3s infinite;
    z-index: 1;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
        border-color: rgba(255, 255, 255, 0.3);
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
        border-color: rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* PREVIEW WRAPPER */
.preview-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
    max-width: 90%;
    margin-bottom: 25px;
    border-radius: 12px;
    /* Matches reference */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: none;
}

.img-preview {
    display: block;
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

.status-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    /* Più alta e centrata */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: 700;
    font-size: 1.15rem;
    /* Scritta più leggibile */
    letter-spacing: 0.5px;
    color: white;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    z-index: 10;
}

.status-verified {
    background: #009e44;
    /* Solid Green matching reference */
    color: #ffffff;
    border: none;
}

.status-failed {
    background: #d32f2f;
    /* Solid Red */
    color: #ffffff;
    border: none;
}

.status-warning {
    background: #fbc02d;
    /* Yellow/Orange */
    color: #333;
    /* Dark text for readability */
    border: none;
}

.instruction-text {
    margin-top: 15px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    letter-spacing: 0.5px;
}

#fileInput {
    display: none;
}

.verify-btn {
    margin-top: 15px;
    padding: 12px 28px;
    background: rgba(15, 82, 186, 0.8);
    /* Theme blue color with some transparency */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.verify-btn:hover {
    background: rgba(15, 82, 186, 1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.reset-btn-small {
    margin-top: 15px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.reset-btn-small:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #f8fafc;
    margin: 2% auto;
    /* 2% from top, centered horizontally */
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    /* Fill most of screen */
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #ffffff;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #94a3b8;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-modal:hover {
    color: #0f172a;
}

.modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Prevent body scroll, handle in columns */
}

.modal-left {
    flex: 1;
    background: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    /* For large images */
}

.modal-img-preview {
    display: block;
    /* Rimuove lo spazio sotto l'immagine inline */
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0;
    /* Gestito dal preview-wrapper */
    margin: 0;
    border: none;
    box-shadow: none;
    /* Gestito dal preview-wrapper */
}

/* Accordion Styles */
.accordion-item {
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.accordion-item:hover {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    text-align: left;
    outline: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-family: var(--font-family);
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-header.active {
    background: #f1f5f9;
    color: #0f172a;
}

.accordion-header .Chevron {
    transition: transform 0.3s;
    font-size: 0.8rem;
    color: #94a3b8;
}

.accordion-header.active .Chevron {
    transform: rotate(180deg);
    color: #3b82f6;
}

.accordion-content {
    display: none;
    padding: 0;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    animation: fadeIn 0.3s ease;
    max-height: 400px;
    /* Limit height */
    overflow-y: auto;
    /* Enable scrolling */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.accordion-content dl {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 12px;
    padding: 20px;
    margin: 0;
    font-size: 0.9rem;
}

.accordion-content dt {
    color: #64748b;
    font-weight: 500;
}

.accordion-content dd {
    margin: 0;
    color: #334155;
    font-weight: 600;
    word-break: break-all;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
    z-index: 1;
}

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

/* Check List in Accordion */
.check-list {
    list-style: none;
    padding: 15px 20px;
    margin: 0;
}

.check-item {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
    gap: 10px;
    color: #334155;
}

.check-item:last-child {
    border-bottom: none;
}

.check-pass {
    color: #16a34a;
}

.check-fail {
    color: #dc2626;
}

.check-warn {
    color: #d97706;
}

.check-info {
    color: #3b82f6;
}

/* Loader */
.loader {
    display: none;
    width: 70px;
    height: 70px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 0.8s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -35px;
    margin-left: -35px;
    z-index: 100;
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
}

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



footer {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
    pointer-events: none;
    letter-spacing: 0.5px;
}

/* Custom Scrollbar for Accordion Content */
.accordion-content::-webkit-scrollbar {
    width: 6px;
}

.accordion-content::-webkit-scrollbar-track {
    background: transparent;
}

.accordion-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        border-radius: 0;
        /* Mobile background fallback if needed, but keeping it clean */
    }

    .right-panel {
        flex: none;
        width: 100%;
        overflow: visible;
        max-height: none;
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }

    .left-panel {
        padding: 40px 20px;
    }

    .img-preview {
        max-height: 40vh;
    }
}