/* --- INIZIO MODIFICA: [magistralis-pwa-bunker/public/css/modals.css] --- */
/* @sentinel_watchdog("Protocollo Estetica Tattica: Sentinel sta consolidando il modulo CSS delle modali. Integrazione completa del layout a due colonne per la risoluzione dei conflitti (left-label vs main-content) e allineamento tipografico per il Cockpit Scambi.") */

/* =========================================
   MODALI STANDARD & TATTICHE MAGISTRALIS
   ========================================= */

.magistralis-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 16, 0.95);
    z-index: 999999;
    backdrop-filter: blur(10px);
    display: none; /* Protetto per il boot */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.magistralis-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* CARD TATTICA BASE */
.magistralis-modal {
    background: linear-gradient(180deg, #0d141e, #0b1118);
    border: 1px solid #c5a059;
    border-radius: 12px;
    width: 560px;
    max-width: 90vw;
    padding: 25px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: loginEntrance 0.4s ease-out;
}

.magistralis-modal-card {
    background: linear-gradient(180deg, #0d141e, #0b1118);
    border: 1px solid #c5a059;
    border-radius: 12px;
    width: 600px;
    max-width: 95vw;
    padding: 30px;
    box-shadow: 0 0 50px rgba(197, 160, 89, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

/* Header & Divider */
.modal-header h3 {
    margin: 0;
    color: #c5a059;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-align: center;
}

.magistralis-modal h4 {
    margin: 0;
    color: #c5a059;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
}

.magistralis-modal h4.danger {
    color: #c0392b;
}

.magistralis-modal p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #c5a059, transparent);
    margin: 15px 0;
    opacity: 0.5;
}

/* ASSE OPERATIVO SCAMBI */
.swap-context-header {
    background: rgba(197, 160, 89, 0.05);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.swap-party { text-align: center; flex: 1; }
.swap-party strong { color: #ffd277; font-family: 'Cinzel'; font-size: 0.8rem; display: block; }
.swap-party span { color: #8899a6; font-size: 0.8rem; }
.swap-arrow { color: #c5a059; font-size: 1.5rem; }

/* -------------------------------------
   LAYOUT DUE COLONNE (Triage Ferie/Scambi)
   ------------------------------------- */
.conflict-left-label {
    width: 280px;
    color: #e74c3c;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1.4;
    text-transform: uppercase;
}

.conflict-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.magistrate-conflict-badge {
    background: #c5a059;
    color: #050a10;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
}

.conflict-solution-box {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.solution-select {
    width: 100%;
    background: #050a10;
    color: #ffd277;
    border: 1px solid #334455;
    padding: 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.solution-select:focus { border-color: #c5a059; }

.modal-subtitle { color: #8899a6; font-size: 0.85rem; text-align: center; margin-bottom: 15px; }

.conflicts-container { 
    max-height: 400px; 
    overflow-y: auto; 
    padding-right: 10px; 
    margin-bottom: 10px; 
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE ed Edge */
}

.conflict-item {
    background: rgba(192, 57, 43, 0.05);
    border-left: 3px solid #c0392b;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.conflict-icon { font-size: 1.2rem; }
.conflict-type { display: block; color: #e74c3c; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.conflict-text p { margin: 0; color: #d1d8e0; font-size: 0.85rem; line-height: 1.4; }

/* AI SENTINEL ADVISOR */
.ai-suggestions-box {
    background: rgba(197, 160, 89, 0.03);
    border: 1px dashed rgba(197, 160, 89, 0.3);
    padding: 15px;
    position: relative;
    margin-top: 10px;
}

.ai-badge {
    position: absolute; top: -10px; left: 15px;
    background: #0d141e; padding: 0 10px;
    color: #c5a059; font-size: 0.8rem; font-weight: bold; letter-spacing: 2px;
}

.ai-text { margin: 0; color: #ffd277; font-size: 0.8rem; font-style: italic; line-height: 1.5; }

/* Footer & Buttons */
.modal-footer, .magistralis-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
}

.btn-gold-mag {
    flex: 1; background: #c5a059; color: #050a10; border: none; padding: 12px;
    font-family: 'Cinzel', serif; font-weight: bold; font-size: 0.8rem; cursor: pointer;
    transition: all 0.3s ease;
}

.btn-gold-mag:hover {
    background: #ffd277;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

.btn-secondary-mag {
    flex: 1; background: transparent; color: #8899a6; border: 1px solid #334455;
    padding: 12px; font-family: 'Cinzel', serif; font-size: 0.8rem; cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-mag:hover {
    border-color: #8899a6;
    color: #fff;
}

/* ANIMAZIONI */
.animate-entrance { animation: modalEntrance 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.animate-exit { animation: modalExit 0.3s ease forwards; }

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

@keyframes modalEntrance {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalExit {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* Occultamento del vettore di scorrimento per il contenitore conflitti (Chrome, Safari, Edge) */
.conflicts-container::-webkit-scrollbar { 
    display: none !important; 
    width: 0 !important;
    height: 0 !important;
}

/* Form inputs standard per modali */
.magistralis-modal input,
.magistralis-modal textarea {
    width: 100%;
    min-height: 42px;
    padding: 12px;
    background: #050a10;
    color: #fff;
    border: 1px solid #333;
    border-radius: 6px;
    resize: none;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.magistralis-modal input:focus,
.magistralis-modal textarea:focus {
    border-color: #c5a059;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.2);
    background: #0d141e;
}
/* --- FINE MODIFICA --- */