/* ESP32 Gate Control System - Dark Theme */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;

    /* Border & Shadow */
    --border-color: #334155;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f35 100%);
    min-height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Login Page Styles */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: var(--bg-tertiary);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
    transform: translateY(-2px);
}

.btn-admin {
    background: var(--accent-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-admin:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

#loginForm .btn {
    width: 100%;
    margin-top: 1rem;
}

/* Error Messages */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-top: 1rem;
    text-align: center;
}

.error-message.shake {
    animation: shake 0.6s ease-in-out;
}

/* Success Messages (z.B. Session-Timeout Info) */
.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% { transform: translateX(0); }
    10%, 30%, 50%, 70% { transform: translateX(-5px); }
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    opacity: 0.3;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 12px var(--accent-green);
}

.status-dot.online::before {
    background: var(--accent-green);
    animation: pulse-ring 2s infinite;
}

.status-dot.offline {
    background: var(--accent-red);
    box-shadow: 0 0 12px var(--accent-red);
}

.status-dot.unknown {
    background: var(--accent-orange);
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Dashboard & Admin Header */
.dashboard-header, .admin-header {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-info span {
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-main, .admin-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.status-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.status-card h3 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    font-size: 1.25rem;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-item .label {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-item .value {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--accent-blue);
    font-weight: 600;
}

/* Gate Controls */
.gate-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* PIN Info Field */
.pin-info {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--accent-blue);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md), 0 0 15px rgba(59, 130, 246, 0.2);
    transition: var(--transition);
}

.pin-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.3);
}

.pin-icon {
    font-size: 1.25rem;
}

.pin-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pin-value {
    font-family: 'Courier New', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    letter-spacing: 0.15em;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.gate-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    border-left: 4px solid var(--accent-blue);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.gate-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.gate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.gate-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
}

.gate-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.gate-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.gate-buttons .btn {
    flex: 1;
    min-width: 140px;
}

/* Activity Log */
.activity-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
}

.activity-section h3 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    font-size: 1.25rem;
}

.log-entries {
    max-height: 350px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    border-radius: 6px;
}

.log-entry:hover {
    background: var(--bg-hover);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-action {
    font-weight: 600;
    color: var(--text-primary);
}

.log-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.log-time {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Admin Panel Styles */
.admin-nav {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    padding: 0;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
}

.nav-btn {
    flex: 1;
    min-width: 200px;
    padding: 1.125rem;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
}

.nav-btn:last-child {
    border-right: none;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.admin-table tr {
    transition: var(--transition);
}

.admin-table tbody tr:hover {
    background: var(--bg-hover);
}

.admin-table td {
    color: var(--text-secondary);
}

.admin-table td strong {
    color: var(--text-primary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    margin: 1rem;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: var(--bg-tertiary);
}

.permissions-group {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.permissions-group h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.75rem;
    border-top: 1px solid var(--border-color);
}

/* System Overview */
.system-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.overview-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
}

.overview-card h4 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.info-item,
.gate-overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.device-name {
    font-weight: 600;
    color: var(--text-primary);
}

.device-details {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* System Resources */
.resource-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.resource-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.resource-value {
    font-family: monospace;
    font-weight: 600;
    color: var(--accent-blue);
}

.resource-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.resource-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.resource-bar-fill.cpu-bar {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.resource-bar-fill.ram-bar {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.resource-bar-fill.disk-bar {
    background: linear-gradient(90deg, #e67e22, #d35400);
}

/* Warnung wenn über 80% */
.resource-bar-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22) !important;
}

/* Kritisch wenn über 90% */
.resource-bar-fill.critical {
    background: linear-gradient(90deg, #e74c3c, #c0392b) !important;
}

.resource-avg {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.resource-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Logs */
.logs-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.logs-filters select,
.logs-filters input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 180px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.logs-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.125rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.log-item:hover {
    background: var(--bg-hover);
}

.log-item:last-child {
    border-bottom: none;
}

.log-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.log-action {
    font-weight: 700;
    color: var(--text-primary);
}

.log-user {
    color: var(--accent-blue);
    font-weight: 600;
}

.log-details {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.log-timestamp {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.message.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* System Info */
.system-info {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.system-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Animation for loading states */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .gate-controls {
        grid-template-columns: 1fr;
    }

    .gate-buttons {
        flex-direction: column;
    }

    .admin-nav {
        flex-direction: column;
    }

    .nav-btn {
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-btn:last-child {
        border-bottom: none;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        margin: 0.5rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .logs-filters {
        flex-direction: column;
    }

    .log-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .log-timestamp {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .dashboard-main,
    .admin-main {
        padding: 0 0.75rem;
    }

    .status-card,
    .gate-card,
    .admin-section {
        padding: 1.25rem;
    }

    .login-container {
        padding: 2rem;
        margin: 0.75rem;
    }
}

/* ==================== WiFi Signal Bars (iPhone Style) ==================== */
.wifi-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    vertical-align: middle;
    margin-left: 4px;
}

.wifi-bar {
    width: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.wifi-bar:nth-child(1) {
    height: 25%;
}

.wifi-bar:nth-child(2) {
    height: 50%;
}

.wifi-bar:nth-child(3) {
    height: 75%;
}

.wifi-bar:nth-child(4) {
    height: 100%;
}

/* WiFi Strength Colors */
.wifi-bars.excellent .wifi-bar {
    background: var(--accent-green);
}

.wifi-bars.good .wifi-bar:nth-child(-n+3) {
    background: var(--accent-green);
}

.wifi-bars.fair .wifi-bar:nth-child(-n+2) {
    background: var(--accent-orange);
}

.wifi-bars.weak .wifi-bar:nth-child(1) {
    background: var(--accent-red);
}

/* Offline state */
.wifi-bars.offline .wifi-bar {
    background: var(--text-muted);
    opacity: 0.3;
}

/* ==================== Footer / Copyright ==================== */
.footer-copyright {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-copyright a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-copyright a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}
