/* ============================================
   GPS Tracker - Premium Dark Theme
   SMI Agents - smiagents.cloud/gps-tracker/
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-primary: #0A0E17;
    --bg-card: #1A1F2E;
    --bg-card-hover: #222840;
    --bg-glass: rgba(26, 31, 46, 0.85);
    --bg-glass-border: rgba(198, 151, 73, 0.15);
    --text-primary: #EAECF0;
    --text-secondary: #98A2B3;
    --text-muted: #667085;
    --accent-gold: #C69749;
    --accent-gold-light: #D4A85A;
    --accent-gold-dark: #A67B2E;
    --accent-green: #22C55E;
    --accent-red: #EF4444;
    --accent-blue: #3B82F6;
    --shadow-gold: rgba(198, 151, 73, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-bn: 'Hind Siliguri', sans-serif;
    --font-en: 'Inter', sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-bn), var(--font-en), sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    min-height: 100vh;               /* fallback - last wins */
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Auth / Login --- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(198, 151, 73, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(198, 151, 73, 0.03) 0%, transparent 50%);
    animation: authGlow 15s ease-in-out infinite alternate;
}

@keyframes authGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, -2%) rotate(3deg); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .icon {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-family: var(--font-en);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-group input {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-en);
    transition: var(--transition-normal);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--shadow-gold);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--accent-red);
    display: none;
}

.auth-error.show {
    display: block;
    animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-bn), var(--font-en), sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #0A0E17;
    box-shadow: 0 4px 15px var(--shadow-gold);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.25);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Main App Layout --- */
.app-container {
    display: none;
    width: 100%;
    height: -webkit-fill-available; /* iOS Safari */
    height: 100dvh;              /* modern: dynamic viewport height */
    height: 100vh;               /* universal fallback - last wins */
    position: relative;
    overflow: hidden;
}

.app-container.active {
    display: block;
}

/* --- Map --- */
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Dark theme for Leaflet */
.leaflet-container {
    background: #0A0E17 !important;
    font-family: var(--font-en), sans-serif;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card-hover) !important;
}

.leaflet-control-attribution {
    background: rgba(10, 14, 23, 0.8) !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
    padding: 2px 8px !important;
}

.leaflet-control-attribution a {
    color: var(--accent-gold) !important;
}

/* Custom marker style */
.custom-marker {
    width: 24px;
    height: 24px;
    background: var(--accent-gold);
    border: 3px solid #0A0E17;
    border-radius: 50%;
    box-shadow: 0 0 20px var(--shadow-gold), 0 0 40px rgba(198, 151, 73, 0.3);
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--shadow-gold), 0 0 40px rgba(198, 151, 73, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px var(--shadow-gold), 0 0 60px rgba(198, 151, 73, 0.5);
        transform: scale(1.1);
    }
}

.custom-marker-inner {
    width: 12px;
    height: 12px;
    background: #0A0E17;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Marker label */
.marker-label {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    color: var(--accent-gold);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-en);
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Trail line */
.trail-line {
    filter: drop-shadow(0 0 6px rgba(198, 151, 73, 0.4));
}

/* --- Top Status Bar --- */
.status-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}

.status-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    pointer-events: auto;
    flex: 1;
    min-width: 0;
}

.status-card.left {
    max-width: 60%;
}

.status-card.right {
    max-width: 40%;
    text-align: right;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green);
    margin-bottom: 4px;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent-green);
}

@keyframes livePulse {
    0%, 100% {
        box-shadow: 0 0 6px var(--accent-green);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 16px var(--accent-green);
        opacity: 0.7;
    }
}

.live-indicator.inactive {
    color: var(--text-muted);
}

.live-indicator.inactive .live-dot {
    background: var(--text-muted);
    animation: none;
    box-shadow: none;
}

.coordinates {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.accuracy-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.area-display {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 6px;
    line-height: 1.4;
}

.area-display .emoji {
    font-size: 16px;
    margin-right: 4px;
}

.area-display .area-en {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}

.battery-info {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-family: var(--font-en);
}

.timestamp-info {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: var(--font-en);
}

/* --- Bottom Controls --- */
.bottom-controls {
    position: absolute;
    bottom: 20px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.controls-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    pointer-events: auto;
}

.controls-row .btn {
    flex: 1;
    max-width: 160px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    pointer-events: auto;
}

.quick-actions .btn-icon {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bg-glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.quick-actions .btn-icon:hover {
    background: var(--bg-card-hover);
}

/* --- Settings Panel --- */
.settings-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 20px 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
}

.settings-panel.active {
    transform: translateY(0);
}

.settings-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-panel .panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-panel .panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition-fast);
}

.settings-panel .panel-close:hover {
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.setting-item .setting-label {
    font-size: 14px;
    color: var(--text-primary);
}

.setting-item .setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.toggle input:checked + .slider {
    background: var(--accent-gold);
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

/* Select Input */
.setting-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font-en);
    outline: none;
    cursor: pointer;
    min-width: 100px;
}

.setting-select:focus {
    border-color: var(--accent-gold);
}

.setting-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* --- History / Bottom Sheet --- */
.history-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(calc(100% - 50px));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    pointer-events: auto;
}

.history-panel.active {
    transform: translateY(0);
}

.history-panel.full {
    transform: translateY(0);
    max-height: 85vh;
}

.history-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 10px auto;
    cursor: pointer;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 12px;
}

.history-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-header .count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.history-header .btn-text {
    background: none;
    border: none;
    color: var(--accent-gold);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-family: var(--font-bn), var(--font-en), sans-serif;
}

.history-header .btn-text:hover {
    background: rgba(198, 151, 73, 0.1);
}

.history-list {
    padding: 0 20px 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.history-item:active {
    transform: scale(0.98);
}

.history-item .item-emoji {
    font-size: 24px;
    line-height: 1;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.history-item .item-details {
    flex: 1;
    min-width: 0;
}

.history-item .item-area {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.history-item .item-area-en {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--text-secondary);
}

.history-item .item-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-en);
}

.history-item .item-time {
    color: var(--text-secondary);
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.history-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* --- Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 90%;
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.3);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-20px); }
}

/* --- Confirmation Dialog --- */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.dialog-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.dialog-box {
    background: var(--bg-card);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px 20px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: dialogIn 0.3s ease;
}

@keyframes dialogIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dialog-box h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dialog-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* --- Install Prompt --- */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    z-index: 1100;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: none;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.install-banner.show {
    display: flex;
}

.install-banner .banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.install-banner .banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner .banner-text h4 {
    font-size: 14px;
    font-weight: 600;
}

.install-banner .banner-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.install-banner .btn-install {
    background: var(--accent-gold);
    color: #0A0E17;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.install-banner .btn-install:hover {
    background: var(--accent-gold-light);
}

.install-banner .btn-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

/* --- Loading / Splash --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-screen .splash-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: splashPulse 2s ease-in-out infinite;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.splash-screen h1 {
    font-family: var(--font-en);
    font-size: 22px;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 1px;
}

.splash-screen p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(198, 151, 73, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto 0;
}

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

/* --- Responsive --- */
@media (max-width: 480px) {
    .status-card {
        padding: 10px 12px;
    }
    
    .status-card.left {
        max-width: 55%;
    }
    
    .status-card.right {
        max-width: 45%;
    }
    
    .coordinates {
        font-size: 10px;
    }
    
    .area-display {
        font-size: 11px;
    }
    
    .controls-row .btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .auth-card {
        padding: 28px 20px;
    }
    
    .history-panel {
        transform: translateY(calc(100% - 44px));
    }
    
    .settings-panel {
        padding: 16px 16px 24px;
    }
}

@media (min-width: 768px) {
    .status-bar {
        top: 20px;
        left: 20px;
        right: 20px;
    }
    
    .bottom-controls {
        bottom: 30px;
        left: 20px;
        right: 20px;
    }
    
    .status-card {
        max-width: 320px;
    }
    
    .history-panel {
        max-width: 400px;
        left: auto;
        right: 20px;
        border-radius: var(--radius-xl);
        transform: translateY(calc(100% - 50px));
        max-height: 70vh;
    }
    
    .settings-panel {
        max-width: 400px;
        left: auto;
        right: 20px;
        border-radius: var(--radius-xl);
    }
}

/* --- Leaflet Overrides --- */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--bg-glass-border) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--bg-glass-border) !important;
}

.leaflet-popup-content {
    font-family: var(--font-bn), var(--font-en), sans-serif !important;
    font-size: 13px !important;
    margin: 10px 14px !important;
}
