/*
===============================================================================
CHANGE LOG
File: static/css/download-areas.css
Document Type: CSS Stylesheet - COMPLETE REWRITE
Purpose: OMAP Offline Dashboard - Clean Modal Architecture
Version: 2025-11-29 v4.0 - Architectural Rewrite
Changes: Complete rewrite to eliminate CSS specificity conflicts
===============================================================================
*/

/* ===== BASE LAYOUT ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    margin: 0;
}

#offline-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* ===== MODAL SYSTEM - CLEAN ARCHITECTURE ===== */
/* Default state: Modal visible for calibration */
.omap-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hidden state: Modal completely removed */
.omap-modal-overlay.hidden {
    display: none;
}

.omap-modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.omap-modal-content h3 {
    margin-top: 0;
    color: #2563eb;
    font-size: 22px;
    margin-bottom: 20px;
}

.omap-acc-text {
    font-size: 24px;
    font-weight: bold;
    color: #4b5563;
    margin: 15px 0;
}

.omap-status-text {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 20px;
}

/* ===== MODAL BUTTONS ===== */
#omap-btn-start {
    width: 100%;
    padding: 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
}

#omap-btn-start:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

#omap-btn-finish {
    width: 100%;
    padding: 16px;
    background: #e5e7eb;
    color: #9ca3af;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: not-allowed;
}

#omap-btn-finish:enabled {
    background: #16a34a;
    color: white;
    cursor: pointer;
}

/* ===== MAP UI ELEMENTS ===== */
#nav-header {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 2000;
}

#status-banner {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    pointer-events: auto;
}

/* ===== CROSSHAIRS SYSTEM ===== */
#crosshairs-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    pointer-events: none;
    display: none; /* Hidden by default, shown after calibration */
}

#crosshairs-overlay.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#crosshairs {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
}

#crosshairs::before {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 2px;
    background: #ff3b30;
    transform: translateX(-50%);
}

#crosshairs::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 2px;
    background: #ff3b30;
    transform: translateY(-50%);
}

#crosshairs-text {
    margin-top: 12px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 4px black;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* ===== LAYER TOGGLE ===== */
#layer-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px;
    border-radius: 12px;
    z-index: 2000;
    gap: 5px;
    pointer-events: auto;
    display: none; /* Hidden by default, shown after calibration */
}

#layer-toggle.show {
    display: flex;
}

#layer-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
}

#layer-toggle button.active {
    background: #16a34a;
    color: white;
}

/* ===== NAMING MODAL ===== */
#omap-name-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 4000;
    display: none;
    justify-content: center;
    align-items: center;
}

#omap-name-modal.show {
    display: flex;
}

#omap-name-box {
    background: white;
    width: 90%;
    max-width: 320px;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
}

#omap-name-input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.btn-confirm {
    flex: 1;
    padding: 12px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* ===== STATUS OVERLAY ===== */
#status-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

#status-message {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: auto;
}
