/* Global Styles */
body {
    background-color: #0b0c10;
    color: #c5c6c7;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background Animation Effect (Optional) */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1f2833 0%, #0b0c10 100%);
    z-index: -1;
}

/* Container for Login */
.login-container {
    background: rgba(31, 40, 51, 0.8);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.2);
    width: 350px;
    text-align: center;
    border: 1px solid #45a29e;
    backdrop-filter: blur(5px);
}

.login-header h2 {
    color: #66fcf1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.5);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #45a29e;
    font-size: 0.9em;
}

.form-control {
    width: 100%;
    padding: 10px;
    background: #0b0c10;
    border: 1px solid #1f2833;
    color: #fff;
    border-radius: 5px;
    box-sizing: border-box; /* Fix padding issue */
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #66fcf1;
    box-shadow: 0 0 8px rgba(102, 252, 241, 0.3);
}

/* Button Styles */
.btn-tech {
    background: transparent;
    color: #66fcf1;
    border: 2px solid #45a29e;
    padding: 10px 20px;
    width: 100%;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-decoration: none; /* Remove underline */
    display: inline-block; /* Ensure proper spacing for links */
    text-align: center;
}

.btn-tech:hover {
    background: #45a29e;
    color: #0b0c10;
    box-shadow: 0 0 15px rgba(69, 162, 158, 0.6);
}

.btn-nav {
    padding: 5px 15px;
    font-size: 0.8em;
    width: auto;
    margin: 0 0 0 10px; /* Add left margin for spacing between buttons */
}

.btn-logout {
    /* Kept for backward compatibility if needed, but inheriting from btn-nav is better or just replace usage */
    padding: 5px 15px;
    font-size: 0.8em;
    width: auto;
    margin: 0 0 0 10px;
}

.btn-admin {
    width: auto;
}

.btn-auto-width {
    width: auto;
}

.btn-sm {
    padding: 2px 10px;
    font-size: 0.8em;
    width: auto;
    margin-right: 5px;
}

.btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-danger:hover {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b6b;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
}

/* Dashboard Specifics */
.dashboard-container {
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #45a29e;
    margin-bottom: 20px;
}

.top-bar h1 {
    color: #66fcf1;
    margin: 0;
    font-size: 1.5em;
}

.version-tag {
    font-size: 0.5em;
    color: #45a29e;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role {
    font-size: 0.8em;
    padding: 2px 8px;
    border: 1px solid #45a29e;
    border-radius: 10px;
    color: #45a29e;
}

.content-area {
    flex-grow: 1;
    background: rgba(31, 40, 51, 0.5);
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
}

.card {
    background: rgba(11, 12, 16, 0.8);
    border: 1px solid #1f2833;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.card h3 {
    color: #c5c6c7;
    margin-top: 0;
    border-bottom: 1px solid #1f2833;
    padding-bottom: 10px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2833;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card-header h3 {
    margin: 0;
    border: none;
    padding-bottom: 0;
}

/* Table Styles */
.table-tech {
    width: 100%;
    border-collapse: collapse;
    color: #c5c6c7;
}

.table-tech th {
    border-bottom: 1px solid #45a29e;
    color: #66fcf1;
    text-align: left;
    padding: 10px;
}

.table-tech td {
    border-bottom: 1px solid #1f2833;
    padding: 10px;
}

/* Admin Card Specifics */
.card-admin {
    border-color: #ff6b6b;
}

.card-admin h3 {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

/* System Status Terminal */
.status-terminal {
    margin-top: 10px;
    color: #45a29e;
    font-family: monospace;
}

/* Camera Grid */
.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.camera-feed {
    background: #000;
    height: 120px;
    border: 1px solid #45a29e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #45a29e;
}

.dashboard-container-sm {
    max-width: 600px;
    margin: 0 auto;
}

/* Focus state for form groups */
.form-group.focused label {
    color: #66fcf1;
}

.error-container {
    text-align: center;
    padding: 50px;
    background: rgba(31, 40, 51, 0.9);
    border: 1px solid #ff6b6b; /* Red border for errors */
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
    max-width: 500px;
    width: 90%;
}

.error-code {
    font-size: 6em;
    color: #ff6b6b;
    margin: 0;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    font-family: 'Segoe UI', sans-serif; /* Monospace-ish look */
}

.error-message {
    font-size: 1.5em;
    color: #c5c6c7;
    margin: 20px 0 40px 0;
}

.error-details {
    color: #66fcf1;
    font-family: monospace;
    font-size: 0.9em;
    margin-bottom: 30px;
}

.btn-error {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-error:hover {
    background: #ff6b6b;
    color: #0b0c10;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}
