/* Existing CSS + New Chat/Map Styles */
:root {
    --bg-dark: #090E17;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --accent-cyan: #06b6d4;
    --accent-cyan-hover: #0891b2;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
body {
    background-color: var(--bg-dark); color: var(--text-main); min-height: 100vh;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
}

.app-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
.glass-panel { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); }
.mt-4 { margin-top: 2rem; }

.top-nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; margin-bottom: 2rem; }
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo i { font-size: 2.2rem; color: var(--accent-cyan); filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4)); }
.logo h2 { font-weight: 600; font-size: 1.4rem; letter-spacing: 0.5px; }

.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-btn, .login-btn { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text-main); font-weight: 500; padding: 0.6rem 1.2rem; border-radius: 8px; transition: all 0.3s ease; border: none; background: transparent; cursor: pointer; font-size: 1rem; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.05); }
.lang-btn { font-weight: bold; padding: 0.6rem 1rem; border: 1px solid var(--glass-border); }
.login-btn { background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.3); color: var(--accent-cyan); }
.login-btn:hover { background: rgba(6, 182, 212, 0.2); transform: translateY(-2px); }

/* User Profile Dropdown */
.auth-container { position: relative; display: flex; align-items: center; }
.user-profile { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.8rem 0.3rem 0.3rem; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 30px; cursor: pointer; transition: all 0.3s; position: relative; user-select: none; }
.user-profile:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-name { font-weight: 500; color: var(--text-main); font-size: 0.95rem; }
.user-profile i.ph-caret-down { color: var(--text-muted); font-size: 0.8rem; margin-left: 0.2rem; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 160px; display: none; flex-direction: column; padding: 0.4rem; z-index: 9999; opacity: 0; transform: translateY(-10px); transition: all 0.2s ease; background: #0f172a; border: 1px solid var(--glass-border); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.dropdown-menu.show { display: flex; opacity: 1; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; color: var(--text-main); text-decoration: none; border-radius: 8px; transition: background 0.2s; font-weight: 500; font-size: 0.95rem; }
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.text-danger { color: var(--danger) !important; }

.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .dashboard-grid { grid-template-columns: 400px 1fr; } }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-header h3 { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }

.status-badge { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.status-badge.online .pulse-dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-badge.offline .pulse-dot { background: var(--danger); }

.stats-cards { display: flex; flex-direction: column; gap: 1rem; }
.card { display: flex; align-items: center; padding: 1.5rem; gap: 1.5rem; transition: transform 0.3s ease, border-color 0.3s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); }
.card-icon { font-size: 2.5rem; color: var(--accent-cyan); opacity: 0.8; }
.card-content { display: flex; flex-direction: column; }
.card-label { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.2rem; }
.card-content h4 { font-size: 1.8rem; font-weight: 600; }
.card-content small { font-size: 1rem; color: var(--text-muted); font-weight: 400; }

/* Chat Panel */
.chat-panel { padding: 1.5rem; display: flex; flex-direction: column; }
.chat-panel h3 { margin-bottom: 1rem; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.chat-box { background: rgba(0, 0, 0, 0.4); border-radius: 8px; padding: 1rem; font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; color: #e2e8f0; min-height: 250px; height: 400px; overflow-y: auto; border: 1px inset rgba(255,255,255,0.05); }
.chat-loading { color: var(--text-muted); text-align: center; margin-top: 2rem; }
.chat-msg { margin-bottom: 0.4rem; line-height: 1.4; word-break: break-word; }
.chat-msg .time { color: var(--text-muted); font-size: 0.8rem; margin-right: 0.5rem; }
.chat-msg .name { color: var(--accent-cyan); font-weight: bold; }
.chat-system { color: #facc15; font-style: italic; }

/* Map Container */
.map-container { height: 100%; min-height: 600px; overflow: hidden; position: relative; }
.map-header { height: 60px; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); position: absolute; top: 0; left: 0; right: 0; z-index: 10; background: inherit; border-radius: 16px 16px 0 0; }
.map-header h3 { font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.map-iframe { position: absolute; top: 60px; left: 0; width: 100%; height: calc(100% - 60px); border: none; background: #000; display: block; }
.btn-icon { background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; }
.btn-icon:hover { color: var(--accent-cyan); }
.map-placeholder { position: absolute; top: 60px; left: 0; width: 100%; height: calc(100% - 60px); display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--text-muted); background: rgba(0,0,0,0.4); }
.map-placeholder i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

/* Fullscreen Map */
.map-container:fullscreen { background: var(--bg-dark); padding: 0; border-radius: 0; border: none; }
.map-container:fullscreen .map-header { background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(5px); border-radius: 0; }
.map-container:fullscreen .map-iframe { height: calc(100vh - 60px); }
.map-container:fullscreen .map-placeholder { height: calc(100vh - 60px); }

/* Admin Section (Bottom) */
.admin-section { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
@media (min-width: 900px) { .admin-section { grid-template-columns: 400px 1fr; } }
.power-controls { padding: 1.5rem; }
.power-controls h3, .console-panel h3 { margin-bottom: 1.5rem; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.btn-group { display: flex; gap: 1rem; }
.btn { flex: 1; display: flex; justify-content: center; align-items: center; gap: 0.5rem; padding: 1rem; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; color: #fff; }
.btn-primary { background: var(--accent-cyan); }
.btn-primary:hover { background: var(--accent-cyan-hover); box-shadow: 0 0 15px rgba(6, 182, 212, 0.4); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

.console-panel { padding: 1.5rem; display: flex; flex-direction: column; }
.console-output { flex-grow: 1; background: rgba(0, 0, 0, 0.4); border-radius: 8px; padding: 1rem; font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; color: #cbd5e1; min-height: 150px; max-height: 250px; overflow-y: auto; margin-bottom: 1rem; white-space: pre-wrap; border: 1px inset rgba(255,255,255,0.05); }
.console-input-wrapper { display: flex; align-items: center; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-border); border-radius: 8px; padding: 0.5rem 1rem; transition: border-color 0.3s; }
.console-input-wrapper:focus-within { border-color: var(--accent-cyan); }
.console-input-wrapper i.ph-caret-right { color: var(--accent-cyan); margin-right: 0.5rem; }
#cmd-input { flex-grow: 1; background: transparent; border: none; color: var(--text-main); font-size: 1rem; outline: none; }
