/* style.css - Version Complète Login + Dashboard */
:root {
    --bg-color: #181c20;
    --card-bg: #22272b;
    --text-main: #e6e6e6;
    --text-muted: #9ba5b0;
    --primary: #68a0a8; /* Teal */
    --success: #57ab5a;
    --danger: #d64640;
    --warning: #c99a2e;
    --disk-color: #9c27b0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 20px;
    background-image: radial-gradient(circle at top right, #22272b 0%, #181c20 60%);
    min-height: 100vh;
}

/* --- LOGIN PAGE --- */
body.login-page {
    display: flex; justify-content: center; align-items: center;
    height: 100vh; margin: 0; padding: 0; overflow: hidden;
}
.login-container {
    background-color: var(--card-bg); padding: 40px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 100%; max-width: 350px;
    text-align: center; border: 1px solid rgba(104, 160, 168, 0.2);
}
.login-logo { height: 80px; margin-bottom: 20px; filter: drop-shadow(0 0 10px rgba(104, 160, 168, 0.2)); }
.login-container h2 { margin-bottom: 30px; color: var(--text-main); font-weight: 300; letter-spacing: 1px; }
.form-group { margin-bottom: 20px; }
.login-form input[type="password"] {
    width: 100%; padding: 12px; background-color: var(--bg-color);
    border: 1px solid #444; border-radius: 6px; color: white;
    font-size: 1em; outline: none; transition: border-color 0.3s;
    box-sizing: border-box;
}
.login-form input[type="password"]:focus { border-color: var(--primary); box-shadow: 0 0 8px rgba(104, 160, 168, 0.3); }
.btn-login { width: 100%; background-color: var(--primary); padding: 12px; font-size: 1em; text-transform: uppercase; margin-top: 10px; border:none; color:white; border-radius:6px; cursor:pointer;}
.btn-login:hover { background-color: #558a91; transform: translateY(-2px); }
.login-error { background-color: rgba(214, 70, 64, 0.2); color: var(--danger); padding: 10px; border-radius: 4px; margin-bottom: 20px; border: 1px solid var(--danger); font-size: 0.9em; }

/* --- DASHBOARD --- */
.main-header { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 40px; padding-top: 20px; position:relative; }
.header-logo { height: 70px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.header-text-group { display: flex; flex-direction: column; }
h1 { margin: 0; font-weight: 700; font-size: 2.2em; line-height: 1; }
.ip-tag { font-size: 0.8em; color: var(--primary); font-weight: 600; margin-top: 5px; display: inline-block; background: rgba(104, 160, 168, 0.1); padding: 4px 10px; border-radius: 4px; }
.logout-link { text-decoration: none; color: var(--danger); font-size: 1.5em; position: absolute; top: 20px; right: 0px; padding: 5px 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; transition: all 0.3s; }
.logout-link:hover { background-color: var(--danger); color: white; box-shadow: 0 0 10px var(--danger); }

/* HOST CONTAINER */
.host-container { max-width: 1400px; margin: 0 auto 40px auto; background-color: var(--card-bg); border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.4); border: 1px solid rgba(104, 160, 168, 0.3); cursor: pointer; transition: all 0.3s ease; }
.host-container:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(104, 160, 168, 0.15); border-color: var(--primary); }
.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.host-title { font-size: 1.4em; font-weight: 700; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.host-stat-item { display: flex; flex-direction: column; gap: 8px; }
.host-label { font-size: 0.9em; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.host-value { font-size: 1.4em; font-weight: 700; }

/* GRILLE VMs */
.container { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; max-width: 1400px; margin: 0 auto; }
.card { background-color: var(--card-bg); border-radius: 8px; padding: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border-left: 4px solid var(--card-bg); border: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; min-height: 240px; }
.card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px rgba(0,0,0,0.3); border-color: var(--primary); }
.card.running { border-left-color: var(--success); }
.card.stopped { border-left-color: var(--danger); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.vm-id { background: rgba(0,0,0,0.2); padding: 3px 8px; border-radius: 4px; font-size: 0.8em; color: var(--text-muted); }
.vm-name { font-weight: 600; font-size: 1.2em; margin-bottom: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-name-link { color: var(--text-main); text-decoration: none; position: relative; z-index: 10; transition: color 0.2s; display: inline-flex; align-items: center; gap: 5px; }
.vm-name-link:hover { color: var(--primary); text-decoration: underline; }
.link-icon { font-size: 0.7em; opacity: 0.5; }
.vm-name-link:hover .link-icon { opacity: 1; }

.status-badge { font-size: 0.7em; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 800; }
.running .status-badge { background: var(--success); color: #fff; }
.stopped .status-badge { background: var(--card-bg); color: var(--text-muted); border: 1px solid var(--danger); }

.stats { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.stat-row { display: flex; justify-content: space-between; font-weight: 500; font-size: 0.9em; color: var(--text-muted); }
.progress-bg { background: rgba(0,0,0,0.3); height: 8px; border-radius: 4px; overflow: hidden; margin-top:4px; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.6s ease; border-radius: 4px; }

/* NETWORK & IO */
.net-section { margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; font-size: 0.85em; color: var(--text-muted); }
.net-item { display: flex; align-items: center; gap: 5px; }
.net-icon-down { color: var(--success); }
.net-icon-up { color: var(--primary); }
.io-delay-warn { color: var(--warning); }
.io-delay-crit { color: var(--danger); font-weight: bold; }

/* ACTIONS */
.modal-actions { margin-top: 25px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn { border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; color: white; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-start { background-color: var(--success); }
.btn-stop { background-color: var(--danger); }
.btn-reboot { background-color: var(--warning); color: #222; }
.btn-ssh { background-color: #3b82f6; margin-right: auto; }

/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.btn-script { background-color: #607d8b; color: white; }
.dropdown-content { display: none; position: absolute; bottom: 100%; right: 0; background-color: var(--card-bg); min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,0.5); border-radius: 6px; border: 1px solid var(--primary); z-index: 2000; overflow: hidden; margin-bottom: 5px; }
.dropdown-content a { color: var(--text-main); padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9em; cursor: pointer; transition: background 0.2s; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dropdown-content a:hover { background-color: var(--primary); color: #fff; }
.dropdown:hover .dropdown-content { display: block; }

/* MODALE & UTILS */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
.modal-content { background-color: var(--card-bg); margin: 5% auto; padding: 30px; border: 1px solid var(--primary); width: 90%; max-width: 600px; border-radius: 12px; position: relative; }
.close-btn { color: var(--text-muted); float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: var(--primary); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.detail-item { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 6px; }
.detail-label { display: block; font-size: 0.8em; color: var(--text-muted); }
.detail-value { font-weight: 600; font-size: 1.1em; }
.loading { text-align: center; color: var(--primary); margin-top: 20px; }
.footer { text-align: center; margin-top: 50px; color: var(--text-muted); font-size: 0.8em; opacity: 0.6; }

/* TOAST */
#toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 4px; padding: 16px; position: fixed; z-index: 3000; left: 50%; bottom: 30px; transform: translateX(-50%); border-left: 5px solid var(--success); }
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }