/* public/assets/css/style.css */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: auto;
    margin: 20px auto;
    padding: 0 20px; 
}

/* --- Navbar --- */
.navbar {
    background-color: #2c3e50; /* Dark blue-gray */
    color: #ecf0f1; /* Light gray */
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.navbar-brand {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.8em;
    font-weight: bold;
}

.navbar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar-nav li {
    margin-left: 25px;
}

.navbar-nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1em;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.navbar-nav a:hover {
    color: #3498db; /* Blue on hover */
}

/* --- Formular general --- */
.form-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
}

.form-card input[type="checkbox"] {
    margin-right: 10px;
}

/* --- Butoane --- */
.button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.button.primary {
    background-color: #3498db; /* Blue */
    color: white;
}

.button.primary:hover {
    background-color: #2980b9;
}

.button.secondary {
    background-color: #95a5a6; /* Gray */
    color: white;
}

.button.secondary:hover {
    background-color: #7f8c8d;
}

.button.success {
    background-color: #27ae60; /* Green */
    color: white;
}

.button.success:hover {
    background-color: #219d55;
}

.button.danger {
    background-color: #e74c3c; /* Red */
    color: white;
}

.button.danger:hover {
    background-color: #c0392b;
}

.button.small {
    padding: 5px 10px;
    font-size: 0.8em;
}

/* --- Alerte --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Tabele de date --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* Pentru a rotunji colțurile tabelului */
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap; /* Previne ruperea textului pe mai multe linii */
}

.data-table th {
    background-color: #34495e; /* Darker blue-gray */
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* --- Statusuri specifice (pentru dispozitive și comenzi) --- */
.status-online { color: #27ae60; font-weight: bold; } /* Green */
.status-offline { color: #f39c12; font-weight: bold; } /* Orange */
.status-pending_approval { color: #7f8c8d; font-weight: bold; } /* Grey */
.status-door-open { color: #e74c3c; font-weight: bold; } /* Red */
.status-door-closed { color: #27ae60; } /* Green */
.status-door-unknown { color: #7f8c8d; } /* Grey */
.status-pending { color: #f39c12; } /* Orange */
.status-sent { color: #3498db; } /* Blue */
.status-delivered { color: #27ae60; } /* Green */
.status-failed { color: #e74c3c; } /* Red */

/* NOU: Statusuri pentru nivelurile de alertă */
.status-info { color: #3498db; font-weight: bold; } /* Blue */
.status-warning { color: #f39c12; font-weight: bold; } /* Orange */
.status-error { color: #e74c3c; font-weight: bold; } /* Red */
.status-critical { color: #c0392b; font-weight: bold; } /* Darker Red */


/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    margin-top: 20px;
}

.section-1-cards {
    flex: 1 1 100%; 
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-card {
    background-color: #fff;
    padding: 5px; /* Redus pentru carduri mai mici */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1 1 calc(10% - 15px); /* 3 carduri pe rând cu spațiu */
    min-width: 200px; /* Lățime minimă pentru carduri, ajustată */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.info-card h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.1em; 
}

.info-card .value {
    font-size: 2em; 
    font-weight: bold;
    color: #3498db;
    margin: 8px 0; 
}

.info-card.active {
    border: 2px solid #3498db;
}

.section-2-hidden-tables {
    flex: 1 1 100%; 
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: none;
	overflow-x: auto;
}

/* --- Stiluri pentru sub-tabelul de comenzi (rândul "umbră") --- */
.commands-sub-table td {
    background-color: #fcfcfc; 
    border-top: 1px solid #ddd; 
    padding: 10px 15px; 
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.05); 
}

.commands-sub-table h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1em;
    text-align: left;
}

/* Stil pentru tabelul mic din interiorul sub-tabelului */
.data-table.small-table {
    width: 100%; 
    margin-top: 0; 
    margin-bottom: 0;
    box-shadow: none; 
    border: 1px solid #e0e0e0; 
}

.data-table.small-table th,
.data-table.small-table td {
    padding: 8px 10px; 
    font-size: 0.85em;
    white-space: normal; 
}

/* Stil pentru spinner-ul de încărcare */
.loading-commands {
    display: block; 
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

/* Stil pentru containerul de conținut al comenzilor */
.commands-content {
    /* Asigură-te că nu este ascuns de CSS */
}

/* --- Stil pentru rândul dispozitivului selectat --- */
.data-table tbody tr.selected-device {
    background-color: #e0f2f7; 
    border-left: 5px solid #3498db;
}

/* --- Stiluri pentru switch-ul de toggle (mutat în settings.php) --- */
.switch {
    position: relative;
    display: inline-block;
    width: 40px; 
    height: 24px; 
    vertical-align: middle; 
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 24px; 
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; 
    width: 16px; 
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%; 
}

input:checked + .slider {
    background-color: #2196F3; 
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(16px); 
    -ms-transform: translateX(16px);
    transform: translateX(16px);
}

/* --- Layout pentru pagina de setări --- */
.settings-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.settings-layout .form-card {
    flex: 1 1 calc(50% - 10px); /* Două coloane pe ecrane largi */
    min-width: 300px;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.setting-item:last-child {
    border-bottom: none;
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .navbar .container {
        flex-direction: column;
    }
    .navbar-nav {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .navbar-nav li {
        margin: 0 10px 10px 10px;
    }
    .info-card {
        flex: 1 1 calc(50% - 10px); 
        min-width: unset; 
    }
    .settings-layout .form-card {
        flex: 1 1 100%; /* O singură coloană pe ecrane mici */
    }
}

@media (max-width: 768px) {
    .info-card {
        flex: 1 1 100%; 
    }
    .data-table th, .data-table td {
        padding: 8px 10px; 
        font-size: 0.9em;
    }
}

/* Stiluri specifice pentru pagina de prezentare */ 
        .hero {
            background-color: #34495e; /* Darker blue-gray, similar to navbar */
            color: #ecf0f1;
            padding: 80px 0;
            text-align: center;
        }
        .hero h1 {
            font-size: 3em;
            margin-bottom: 20px;
        }
        .hero p {
            font-size: 1.2em;
            margin-bottom: 40px;
        }
        .hero .button {
            background-color: #3498db;
            color: white;
            padding: 15px 30px;
            font-size: 1.1em;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }
        .hero .button:hover {
            background-color: #2980b9;
        }
        .features {
            padding: 60px 0;
            text-align: center;
            background-color: #f4f7f6; /* Folosim fundalul general al body-ului */
        }
        .features h2 {
            font-size: 2.5em;
            margin-bottom: 40px;
            color: #2c3e50;
        }
        .feature-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 30px;
            margin-top: 30px;
        }
        .feature-item {
            flex: 0 1 calc(33% - 40px); /* 3 elemente pe rând */
            background-color: #fff; /* Fundal alb pentru elemente */
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            text-align: left;
            min-width: 280px;
        }
        .feature-item h3 {
            color: #3498db;
            margin-top: 0;
            font-size: 1.5em;
        }
        .feature-item p {
            color: #555;
            line-height: 1.7;
        }
        .footer {
            background-color: #2c3e50;
            color: #ecf0f1;
            text-align: center;
            padding: 30px 0;
            margin-top: 50px;
        }
        .footer p {
            margin: 0;
            font-size: 0.9em;
        }
        .footer a {
            color: #3498db;
            text-decoration: none;
        }
        .footer a:hover {
            text-decoration: underline;
        }
        @media (max-width: 768px) {
            .feature-item {
                flex: 0 1 100%;
            }
        }
		
/* Stiluri specifice pentru pagina de login */
        .login-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh; /* Ocupă toată înălțimea viewport-ului */
            background-color: #f4f7f6; /* Fundal similar cu body-ul */
        }
        .login-card {
            width: 100%;
            max-width: 400px; /* Lățime maximă pentru formular */
            padding: 30px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
            text-align: center;
        }
        .login-card h1 {
            color: #2c3e50;
            margin-bottom: 25px;
            font-size: 2em;
        }
        .login-card label {
            text-align: left;
            margin-bottom: 5px;
            font-weight: bold;
            color: #555;
            display: block; /* Asigură că label-ul ocupă toată lățimea */
        }
        .login-card input[type="text"],
        .login-card input[type="password"] {
            width: calc(100% - 20px); /* Lățime completă minus padding */
            padding: 10px;
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-sizing: border-box; /* Include padding-ul în lățime */
            font-size: 1em;
        }
        .login-card .button.primary {
            width: 100%; /* Butonul ocupă toată lățimea */
            padding: 12px 0;
            font-size: 1.1em;
        }
        .login-card .back-to-home {
            margin-top: 20px;
            font-size: 0.9em;
        }
        .login-card .back-to-home a {
            color: #3498db;
            text-decoration: none;
        }
        .login-card .back-to-home a:hover {
            text-decoration: underline;
        }