/* ============================================
   TR-GOZU - Acil Durum Yönetim Sistemi
   Ana Stil Dosyası
   ============================================ */

/* CSS Değişkenleri */
:root {
    --primary: #ff4757;
    --primary-dark: #c0392b;
    --secondary: #00d2ff;
    --secondary-dark: #0098b3;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-medium: #334155;
    --success: #2ecc71;
    --success-light: rgba(46, 204, 113, 0.15);
    --warning: #ffa502;
    --warning-light: rgba(255, 165, 2, 0.15);
    --danger: #ff4757;
    --danger-light: rgba(255, 71, 87, 0.15);
    --police: #3498db;
    --fire: #e67e22;
    --hospital: #9b59b6;
    --text: #ffffff;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(30, 41, 59, 0.95);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
}

/* Reset ve Temel Stiller */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ============================================
   Modal ve Overlay Stilleri
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 20px;
}

.modal-content {
    background: var(--dark-light);
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--secondary);
    box-shadow: var(--shadow);
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

.modal-sm { max-width: 400px; }

.modal-title {
    color: var(--secondary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
}

.modal-subtitle {
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin: 15px 0 8px;
}

.modal-body {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.memorial {
    color: var(--text-dim);
    font-style: italic;
}

.privacy-list {
    list-style: none;
    padding-left: 0;
}

.privacy-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.privacy-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--secondary);
}

.accept-checkbox {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.875rem;
    cursor: pointer;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius);
}

.accept-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--secondary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons .btn { flex: 1; }

/* ============================================
   Buton Stilleri
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }

.btn-sm { padding: 10px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 18px 28px; font-size: 1rem; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3); }

.btn-secondary { background: var(--dark-medium); color: white; }
.btn-secondary:hover { background: #475569; }

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}
.btn-outline:hover { background: rgba(0, 210, 255, 0.1); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-location {
    background: rgba(0, 210, 255, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(0, 210, 255, 0.3);
}
.btn-location:hover { background: rgba(0, 210, 255, 0.2); }

.btn-volunteer {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(0, 210, 255, 0.2));
    color: var(--text);
    border: 1px solid rgba(155, 89, 182, 0.4);
}
.btn-volunteer:hover { background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(0, 210, 255, 0.3)); }

.btn-ai {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: white;
    border: none;
}
.btn-ai:hover { box-shadow: 0 8px 20px rgba(255, 165, 2, 0.3); }

.btn-logout {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--primary);
    margin-top: 15px;
}
.btn-logout:hover { background: rgba(255, 71, 87, 0.2); }

/* ============================================
   Form Stilleri
   ============================================ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

input, textarea, select {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--dark-medium);
    background: var(--dark);
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-dim);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.toggle-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.toggle-icon:hover { color: var(--secondary); }

/* ============================================
   Auth (Giriş) Stilleri
   ============================================ */
#authSection {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: radial-gradient(circle at center, #1e293b, #050a14);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-logo {
    position: absolute;
    width: 250px;
    height: auto;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
    filter: grayscale(30%);
    transition: all 0.5s ease;
}

.logo-left { right: calc(50% + 320px); }
.logo-right { left: calc(50% + 320px); }

.auth-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-title {
    color: var(--secondary);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
}

.auth-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 8px;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--dark-medium);
}

.tab-btn {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.form-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive Auth */
@media (max-width: 1100px) {
    .auth-logo { width: 150px; }
    .logo-left { right: calc(50% + 220px); }
    .logo-right { left: calc(50% + 220px); }
}

@media (max-width: 900px) {
    .auth-logo { display: none; }
}

/* ============================================
   Layout Stilleri
   ============================================ */
.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100vh;
    height: 100dvh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    background: var(--dark);
    border-right: 1px solid rgba(0, 210, 255, 0.1);
    overflow: hidden;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.sidebar-content::-webkit-scrollbar { width: 4px; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

/* ============================================
   Sidebar Panel Stilleri
   ============================================ */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.user-details {
    flex: 1;
}

.user-details h3 {
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--secondary);
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.battery-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.divider {
    border: none;
    border-top: 1px solid var(--dark-medium);
    margin: 15px 0;
}

.panel-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 20px 0 10px;
    letter-spacing: 1px;
}

.text-danger { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-hospital { color: var(--hospital); }

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Risk Grid */
.risk-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    border-left: 3px solid #ccc;
    font-size: 0.8125rem;
}

.risk-item span { color: var(--text-muted); }
.risk-item b { font-size: 0.875rem; }

.risk-red { border-left-color: var(--primary); }
.risk-red b { color: var(--primary); }

.risk-blue { border-left-color: var(--secondary); }
.risk-blue b { color: var(--secondary); }

.risk-orange { border-left-color: var(--warning); }
.risk-orange b { color: var(--warning); }

/* Info Box */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: var(--radius);
    border-left: 3px solid var(--secondary);
    font-size: 0.8125rem;
    margin-bottom: 10px;
}

.info-box b {
    color: var(--secondary);
    display: block;
    margin-bottom: 5px;
}

.info-box.assembly { border-left-color: var(--success); }
.info-box.assembly b { color: var(--success); }

.info-box.hospital { border-left-color: var(--hospital); }
.info-box.hospital b { color: var(--hospital); }

/* Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.health-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.health-btn:hover { transform: scale(1.02); }
.health-btn.health-active { border-color: white; }

.health-icon { font-size: 1.25rem; }

/* Listeler */
.admin-list, .sos-list, .tracking-list, .routing-list, .institution-list,
.volunteer-list, .announcement-list, .missing-list, .verification-list,
.family-list, .help-list, .inbox-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8125rem;
}

.admin-list::-webkit-scrollbar,
.sos-list::-webkit-scrollbar,
.tracking-list::-webkit-scrollbar,
.routing-list::-webkit-scrollbar,
.institution-list::-webkit-scrollbar,
.volunteer-list::-webkit-scrollbar,
.announcement-list::-webkit-scrollbar,
.missing-list::-webkit-scrollbar,
.verification-list::-webkit-scrollbar,
.family-list::-webkit-scrollbar,
.help-list::-webkit-scrollbar,
.inbox-list::-webkit-scrollbar { width: 4px; }

.admin-list::-webkit-scrollbar-thumb,
.sos-list::-webkit-scrollbar-thumb,
.tracking-list::-webkit-scrollbar-thumb,
.routing-list::-webkit-scrollbar-thumb,
.institution-list::-webkit-scrollbar-thumb,
.volunteer-list::-webkit-scrollbar-thumb,
.announcement-list::-webkit-scrollbar-thumb,
.missing-list::-webkit-scrollbar-thumb,
.verification-list::-webkit-scrollbar-thumb,
.family-list::-webkit-scrollbar-thumb,
.help-list::-webkit-scrollbar-thumb,
.inbox-list::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

/* ============================================
   Harita Stilleri
   ============================================ */
#mapWrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#map {
    background: #0b0f19;
    width: 100%;
    height: 100%;
}

.map-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.map-ctrl-btn:hover { background: rgba(0, 210, 255, 0.2); border-color: var(--secondary); }
.map-ctrl-btn.active { background: rgba(0, 210, 255, 0.25); border-color: var(--secondary); color: var(--secondary); }

/* Map Overlay Panel */
.map-overlay-panel {
    position: absolute;
    top: 70px;
    left: 15px;
    width: 320px;
    max-height: calc(100% - 100px);
    background: var(--glass);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: var(--radius-lg);
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(15px);
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 210, 255, 0.1);
    border-bottom: 1px solid var(--dark-medium);
}

.overlay-header h4 {
    font-size: 0.875rem;
    color: var(--secondary);
}

.overlay-content {
    padding: 12px;
    overflow-y: auto;
    max-height: 400px;
    font-size: 0.8125rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover { opacity: 1; }

/* ============================================
   SOS Butonu
   ============================================ */
.sos-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.5);
    animation: sosPulse 2s infinite;
    transition: transform 0.2s;
}

.sos-btn:hover { transform: scale(1.1); }
.sos-btn:active { transform: scale(0.95); }
.sos-btn.panic { animation: sosPanic 0.3s infinite; background: linear-gradient(135deg, #ff0000, #8b0000); }

@keyframes sosPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { box-shadow: 0 0 0 30px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

@keyframes sosPanic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* SOS Modal */
.sos-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
}

.sos-modal-content {
    background: linear-gradient(180deg, var(--dark-light), var(--dark));
    border: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 0 80px rgba(255, 71, 87, 0.4);
}

.sos-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 71, 87, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: pulse 1s infinite;
}

.sos-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.sos-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 25px;
}

.sos-countdown {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary);
    margin: 20px 0;
    text-shadow: 0 0 40px rgba(255, 71, 87, 0.6);
    font-variant-numeric: tabular-nums;
}

.sos-status {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
}

.sos-btn-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.sos-btn-row .btn { padding: 14px 20px; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   FAB (Floating Action Button) Stilleri
   ============================================ */
.msg-fab, .chat-fab, .voice-fab {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.msg-fab { bottom: 130px; right: 30px; background: linear-gradient(135deg, var(--hospital), #6c3483); color: white; }
.chat-fab { bottom: 190px; right: 30px; background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: white; }
.voice-fab { bottom: 250px; right: 30px; background: linear-gradient(135deg, var(--warning), #e67e22); color: white; }

.msg-fab:hover, .chat-fab:hover, .voice-fab:hover { transform: scale(1.1); }

.unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Chat Paneli
   ============================================ */
.chat-panel, .messaging-panel {
    position: fixed;
    bottom: 200px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: 60vh;
    background: var(--dark-light);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: var(--radius-lg);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.messaging-panel { border-color: rgba(155, 89, 182, 0.3); }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(0, 210, 255, 0.1);
    border-bottom: 1px solid var(--dark-medium);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--secondary);
}

.messaging-panel .panel-title { color: var(--hospital); }

.chat-messages, .thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.chat-messages::-webkit-scrollbar, .thread-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb, .thread-messages::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.8125rem;
    line-height: 1.5;
    max-width: 85%;
    word-break: break-word;
}

.chat-user { background: rgba(0, 210, 255, 0.15); margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bot { background: rgba(255, 255, 255, 0.05); margin-right: auto; border-bottom-left-radius: 4px; }

.chat-typing {
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.chat-input-row {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--dark-medium);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-row input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--dark-medium);
    background: var(--dark);
    color: white;
    font-size: 0.8125rem;
}

.chat-input-row input:focus {
    border-color: var(--secondary);
    outline: none;
}

.chat-input-row .btn { width: auto; padding: 10px 14px; }

/* Messaging Specific */
.inbox-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--dark-medium);
}

.inbox-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--dark-medium);
    cursor: pointer;
    transition: background 0.2s;
}

.inbox-item:hover { background: rgba(155, 89, 182, 0.1); }

.thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(155, 89, 182, 0.1);
    border-bottom: 1px solid var(--dark-medium);
}

.back-btn {
    background: none;
    border: none;
    color: var(--hospital);
    font-size: 1.25rem;
    cursor: pointer;
}

.thread-header span {
    font-size: 0.875rem;
    font-weight: 600;
    word-break: break-all;
}

.msg-bubble {
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    max-width: 80%;
    word-break: break-word;
}

.msg-sent { background: rgba(0, 210, 255, 0.15); margin-left: auto; border-bottom-right-radius: 4px; }
.msg-received { background: rgba(255, 255, 255, 0.05); margin-right: auto; border-bottom-left-radius: 4px; }

/* ============================================
   Sesli Uyarı Paneli
   ============================================ */
.voice-alert-panel {
    position: fixed;
    bottom: 310px;
    right: 30px;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: var(--dark-light);
    border: 1px solid rgba(255, 165, 2, 0.3);
    border-radius: var(--radius-lg);
    z-index: 2500;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.voice-alert-content {
    padding: 20px;
    text-align: center;
}

.voice-alert-content .btn {
    margin-bottom: 15px;
}

.voice-settings {
    text-align: left;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.voice-settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.voice-settings input {
    width: 16px;
    height: 16px;
    accent-color: var(--warning);
}

/* ============================================
   Admin Kartları
   ============================================ */
.admin-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--secondary);
}

.admin-card:hover { background: rgba(0, 210, 255, 0.08); }

.admin-card.sos-card {
    border-left-color: var(--primary);
    background: rgba(255, 71, 87, 0.05);
}

.admin-card.sos-card:hover { background: rgba(255, 71, 87, 0.12); }

.admin-card.panic-card {
    border-left-color: var(--primary);
    background: rgba(255, 71, 87, 0.1);
    animation: panicGlow 1s infinite;
}

@keyframes panicGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 71, 87, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 71, 87, 0.6); }
}

/* Panik Flash */
@keyframes panicFlash {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary); }
}

body.panic-flash { border: 4px solid transparent; animation: panicFlash 0.3s linear 5; }

/* ============================================
   Kartlar
   ============================================ */
.volunteer-card, .routing-card, .institution-card, .announcement-card,
.missing-card, .family-card, .help-card, .verification-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.volunteer-card:hover, .routing-card:hover, .institution-card:hover,
.announcement-card:hover, .missing-card:hover, .family-card:hover,
.help-card:hover, .verification-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.volunteer-card { border-left: 3px solid var(--hospital); }
.routing-card { border-left: 3px solid var(--warning); }
.institution-card { border-left: 3px solid var(--success); }
.announcement-card { border-left: 3px solid var(--warning); }
.missing-card { border-left: 3px solid var(--primary); }
.family-card { border-left: 3px solid var(--secondary); }
.help-card { border-left: 3px solid var(--success); }
.verification-card { border-left: 3px solid var(--success); }

.announcement-card.critical { border-left-color: var(--primary); background: rgba(255, 71, 87, 0.08); }
.announcement-card.high { border-left-color: var(--warning); background: rgba(255, 165, 2, 0.08); }

.verification-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: var(--radius);
    margin: 15px 0;
    font-size: 0.875rem;
}

.institution-details {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.institution-details .institution-card {
    cursor: default;
    margin-bottom: 6px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-light);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    z-index: 5000;
    box-shadow: var(--shadow);
    border: 1px solid var(--secondary);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dark-medium);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Hamburger ve Sidebar Overlay
   ============================================ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2500;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.hamburger-btn:hover { background: rgba(0, 210, 255, 0.2); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    backdrop-filter: blur(3px);
}

/* ============================================
   3D Mode
   ============================================ */
#mapWrapper.mode-3d { perspective: 1200px; perspective-origin: 50% 100%; }
#mapWrapper.mode-3d #map { transform: rotateX(40deg); transform-origin: center bottom; height: 140% !important; transition: transform 0.5s ease, height 0.5s ease; }

/* ============================================
   Leaflet Özelleştirmeleri
   ============================================ */
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper { background: var(--dark-light); color: white; border-radius: var(--radius); }
.leaflet-popup-tip { background: var(--dark-light); }
.leaflet-control-zoom { border: none !important; }
.leaflet-control-zoom a { background: var(--dark-light) !important; color: white !important; border: 1px solid var(--dark-medium) !important; }
.leaflet-control-zoom a:hover { background: var(--secondary) !important; }

/* ============================================
   Responsive Tasarım
   ============================================ */
@media (max-width: 768px) {
    .layout { grid-template-columns: 1fr !important; }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        width: 85vw;
        max-width: 360px;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 2500;
        transition: left 0.3s ease;
        border-right: 2px solid rgba(0, 210, 255, 0.2);
        padding-top: 70px;
    }

    .sidebar.open { left: 0; }
    .sidebar-overlay.show { display: block; }
    .hamburger-btn { display: flex; }

    #mapWrapper, #map { height: 100vh !important; height: 100dvh !important; width: 100% !important; }

    .auth-card { width: 95vw !important; padding: 25px !important; }

    .sos-btn { bottom: 20px; right: 20px; width: 70px; height: 70px; font-size: 0.875rem; }

    .map-controls { top: 70px; right: 10px; }
    .map-ctrl-btn { width: 40px; height: 40px; }

    .msg-fab { bottom: 110px; right: 15px; width: 46px; height: 46px; }
    .chat-fab { bottom: 170px; right: 15px; width: 46px; height: 46px; }
    .voice-fab { bottom: 230px; right: 15px; width: 46px; height: 46px; }

    .chat-panel, .messaging-panel {
        bottom: 180px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: none;
        height: 55vh;
    }

    .voice-alert-panel {
        bottom: 290px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: none;
    }

    .sos-modal-content { width: 95vw !important; padding: 25px !important; }
    .sos-countdown { font-size: 4rem; }
    .sos-icon { width: 60px; height: 60px; }

    .map-overlay-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .health-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .auth-card { padding: 20px !important; }
    .modal-content { padding: 20px !important; }
    .sidebar { width: 90vw; }
    .sos-btn { bottom: 15px; right: 15px; width: 65px; height: 65px; }
    .msg-fab { bottom: 100px; right: 10px; }
    .chat-fab { bottom: 155px; right: 10px; }
    .voice-fab { bottom: 210px; right: 10px; }
}

/* ============================================
   Leaflet Custom Popup
   ============================================ */
.sos-popup {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 11px;
}

.team-popup {
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 11px;
}

/* ============================================
   Heatmap Marker Stilleri
   ============================================ */
.heatmap-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.heatmap-critical { background: rgba(255, 71, 87, 0.8); animation: heatmapPulse 1s infinite; }
.heatmap-high { background: rgba(255, 165, 2, 0.8); }
.heatmap-medium { background: rgba(52, 152, 219, 0.8); }
.heatmap-low { background: rgba(46, 204, 113, 0.8); }

@keyframes heatmapPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   Rota Stilleri
   ============================================ */
.safe-route { stroke: var(--success); stroke-width: 4; }
.dangerous-route { stroke: var(--primary); stroke-width: 4; stroke-dasharray: 10, 5; }
