:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-darker);
    color: var(--text-light);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.gps-viewer {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.map-container {
    position: relative;
    height: 70vh;
    min-height: 500px;
}

#mainMap {
    width: 100%;
    height: 100%;
}

.mini-map-container {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 220px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

#miniMap {
    width: 100%;
    height: 100%;
}

.mini-map-label {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0 0 6px 6px;
    z-index: 1;
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-light);
    border: 1px solid var(--text-muted);
}

.btn-secondary:hover {
    background: #334155;
}

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

.status-bar {
    position: absolute;
    bottom: 20px;
    right: 15px;
    background: rgba(15, 23, 42, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-bar .status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.status-bar .status-row:last-child {
    margin-bottom: 0;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.status-dot.active {
    background: #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.map-type-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.map-type-btn {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-type-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.map-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.gps-not-available {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(15, 23, 42, 0.95);
    padding: 40px;
    border-radius: 12px;
    z-index: 20;
}

.gps-not-available svg {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    color: var(--danger);
}

.gps-not-available h3 {
    margin-bottom: 10px;
}

.gps-not-available p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.zoom-controls {
    position: absolute;
    right: 15px;
    top: 190px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-dark);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .mini-map-container {
        width: 160px;
        height: 120px;
    }
    
    .map-container {
        height: 60vh;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}
