﻿/* --- START OF FILE css/layout_fixed.css --- */

/* =========================================
   1. LAYOUT PRINCIPALE: FISSO
========================================= */

html, body {
    height: 100%;
    margin: 0;
    padding: 0 !important;
    overflow: hidden !important; 
    display: flex;
    flex-direction: column;
}

/* 2. CONTENITORE PRINCIPALE APP */
#app-container {
    flex-grow: 1;
    min-height: 0; /* Permette al contenuto di restringersi */
    width: 100%;
    overflow: hidden !important; 
    position: relative;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* =========================================
   SCROLL SPECIFICO PER LOGIN/RICHIESTE
========================================= */

main.container {
    height: 100%; 
    width: 100%;
    overflow-y: auto !important; 
    padding: 15px;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

main.container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}


/* =========================================
   3. GESTIONE VISTE INTERNE
========================================= */

.view-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding-top: 10px;
    padding-bottom: 15px;
    box-sizing: border-box;
}

.split-view-wrapper {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 35% 1fr; 
    gap: 30px;
    overflow: hidden;
    min-height: 0;
    padding: 0 10px;
}

.left-col, .right-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 4. HEADER VISTA */
.view-header {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: 15px;
    z-index: 20;
}

/* 5. TABELLA SCROLLABILE & LOG CONTAINER */
.table-scroll-wrapper, #sa-logs-container {
    flex: 1; 
    min-height: 0;
    overflow-y: auto;
    border-radius: 8px;
    border: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.table-scroll-wrapper::-webkit-scrollbar, #sa-logs-container::-webkit-scrollbar { 
    display: none; 
}

/* --- INIZIO MODIFICA: FIX ANIMAZIONE FLIP E PROSPETTIVA --- */

/* Aggiungiamo la prospettiva al contenitore che ospita il flip */
.split-view-wrapper {
    perspective: 1500px;
}

@-webkit-keyframes flip-2-hor-bottom-1 {
  0% {
    -webkit-transform: translateY(0) rotateX(0);
            transform: translateY(0) rotateX(0);
    -webkit-transform-origin: 50% 100%;
            transform-origin: 50% 100%;
    opacity: 1;
  }
  100% {
    -webkit-transform: translateY(100%) rotateX(180deg);
            transform: translateY(100%) rotateX(180deg);
    -webkit-transform-origin: 50% 0%;
            transform-origin: 50% 0%;
    opacity: 0;
  }
}
@keyframes flip-2-hor-bottom-1 {
  0% {
    transform: translateY(0) rotateX(0);
    transform-origin: 50% 100%;
    opacity: 1;
  }
  100% {
    transform: translateY(100%) rotateX(180deg);
    transform-origin: 100% 0%;
    opacity: 0;
  }
}

@keyframes flip-in-hor-bottom {
  0% {
    transform: translateY(-100%) rotateX(-180deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotateX(0);
    opacity: 1;
  }
}

.animate-flip-out {
    animation: flip-2-hor-bottom-1 0.4s cubic-bezier(0.455, 0.030, 0.515, 0.955) both;
    pointer-events: none; /* Impedisce click durante l'animazione */
}

.animate-flip-in {
    animation: flip-in-hor-bottom 0.4s cubic-bezier(0.455, 0.030, 0.515, 0.955) both;
}

/* 6. PULSANTI */
.buttons-row {
    flex-shrink: 0;
    margin-top: 15px;
}

/* --- DETTAGLIO --- */
.detail-panel-container {
    background: rgba(13, 20, 30, 0.85);
    /* Applicazione bordo identico al Centro di Comando */
    border: 2px solid #c5a059 !important;
    border-radius: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    transition: opacity 0.3s;
    opacity: 1;
    pointer-events: auto;
}

.detail-header {
    background: linear-gradient(90deg, #141e30, #243b55);
    border-bottom: 2px solid #c5a059;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    flex-shrink: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.detail-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 25px;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.detail-scroll-area::-webkit-scrollbar { display: none; }

.detail-group {
    background: rgba(255,255,255,0.03);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #c5a059;
}

.group-title {
    display: block;
    color: #c5a059;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    border-bottom: 1px solid #c5b89a;
    padding-bottom: 4px;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.input-wrap label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 3px;
}

/* =========================================
   STILE INPUT E TEXTAREA (SELECT rimosso)
========================================= */

.input-wrap input, 
.input-wrap textarea {
    background: rgba(0,0,0,0.4);
    border: 1px solid #c5b89a;
    color: white;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-wrap input:focus, 
.input-wrap textarea:focus {
    border-color: #c5a059;
    box-shadow: 0 0 10px #c5b89a;
    outline: none;
    background: rgba(0,0,0,0.6);
}

.input-wrap input:disabled, 
.input-wrap textarea:disabled {
    background: rgba(0,0,0,0.6);
    border-color: rgba(255,255,255,0.05);
    color: #555;
    cursor: not-allowed;
}

/* --- Tabelle Piccole --- */
.mini-table-container {
    max-height: 100px;
    overflow-y: auto;
    border: 2px solid #c5a059;
    margin-bottom: 5px;
    border-radius: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mini-table-container::-webkit-scrollbar { display: none; }

.mini-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.mini-table th { background: #141e30; color: #b0bec5; padding: 4px; text-align: left; }
.mini-table td { padding: 4px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; }

.mini-table tr.selected-mini td {
    background-color: #c5b89a;
    border-top: 1px solid rgba(197, 160, 89, 0.6);
    border-bottom: 1px solid rgba(197, 160, 89, 0.6);
}

.mini-actions { text-align: right; }
.mini-btn {
    background: none; border: 1px solid #b0bec5; color: #b0bec5;
    font-size: 0.8rem; padding: 2px 6px; cursor: pointer; border-radius: 3px;
}
.mini-btn:hover { border-color: #c5a059; color: #c5a059; }

.detail-footer-row {
    flex-shrink: 0;
    display: flex;
    gap: 15px;
    width: 100%;
}

.detail-footer-row .btn-wrapper, 
.buttons-row .btn-wrapper {
    margin: 0 !important;
}

#request-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 10px 40px;
    width: 100%;
    box-sizing: border-box;
}

#request-list .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* =========================================
   STILE GLOBALE PER ANTEPRIMA STAMPA
========================================= */
.magistralis-preview-pane {
    background: #0d141e;
    color: #ffffff;
    padding: 20px;
    border: 1px solid #c5a059;
    border-radius: 8px;
    min-height: 400px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 0.8rem;
}

.magistralis-preview-pane h2,
.magistralis-preview-pane h3,
.magistralis-preview-pane div {
    color: #ffffff !important;
}

.magistralis-preview-pane table {
    width: 100%;
    border-collapse: collapse;
    color: #b0bec5;
}

.magistralis-preview-pane th {
    background: linear-gradient(to bottom, #243b55, #141e30);
    border: 1px solid #444;
    padding: 8px;
    font-weight: bold;
    color: #c5a059;
}

.magistralis-preview-pane td {
    border: 1px solid #444;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    color: #c5a059; 
}

.magistralis-preview-pane .highlight {
    background-color: #c5b89a !important;
}

.magistralis-preview-pane .assenti-row td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.magistralis-preview-pane .assenti-cell {
    text-align: left !important;
    color: #ffffff !important; 
}

.magistralis-preview-pane .footer-notes,
.magistralis-preview-pane .legenda-container {
    border-top: 1px solid #c5a059;
    margin-top: 20px;
    padding-top: 15px;
}

/* --- FIX ESTETICO: LOG SUPERADMIN GLASS STYLE --- */

/* Rende trasparente il contenitore principale dei log per mostrare la Card sotto */
#sa-logs-container, 
#sa-logs-container .log-view {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Stile per le aree di testo (Console, Risultati Query, Tabelle) */
#vm-terminal-content, 
#log-results-container,
#view-queue, 
#view-health, 
#view-svc, 
#view-users {
    background-color: rgba(0, 0, 0, 0.4) !important; /* Semi-trasparente scuro */
    border: 1px solid #c5b89a !important;
    border-radius: 6px !important;
    backdrop-filter: none !important; /* Evita doppi blur */
    margin-top: 5px;
}

/* Header della console VM (Input comandi) */
#vm-command-line {
    background-color: rgba(20, 20, 20, 0.7) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 0 6px 6px !important;
}

/* Tab di navigazione log */
.log-tab {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
    color: #b0bec5;
    font-weight: 600;
}
.log-tab:hover {
    color: #ffd277;
    background: rgba(255, 255, 255, 0.05);
}
.log-tab.active {
    color: #c5a059;
    background: #c5b89a;
    border: 1px solid #c5b89a;
}