/**
 * DisasterCorp Tactical Map - Stylesheet
 * 16x16 km Military Grid, Map Overlay, Movement Directions & Responsive Touch Controls
 */
.wp-tactical-map-wrapper {
    position: relative;
    width: 100%;
    min-height: 520px;
    background-color: #020617;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #f8fafc;
}

.wp-tactical-controls-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.wp-tactical-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(51, 65, 85, 0.9);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    font-family: monospace;
    color: #f8fafc;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.wp-tactical-badge .wp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: wpPulse 2s infinite;
}

@keyframes wpPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.wp-tactical-hud-right {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.wp-tactical-hud-desktop-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.wp-tactical-hud-mobile-buttons {
    display: none;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .wp-tactical-hud-desktop-buttons {
        display: none !important;
    }
    .wp-tactical-hud-mobile-buttons {
        display: flex !important;
    }
}

.wp-tactical-btn {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(51, 65, 85, 0.9);
    color: #f1f5f9;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.wp-tactical-btn:hover {
    background: #1e293b;
    border-color: #f59e0b;
}

.wp-tactical-btn.active {
    background: #f59e0b;
    color: #020617;
    border-color: #f59e0b;
    font-weight: bold;
}

.wp-tactical-btn.wp-btn-dark-toggle.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #6366f1;
}

.wp-tactical-canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: grab;
    background: #020617;
    touch-action: none; /* Prevents page scroll while panning map touches */
}

.wp-tactical-canvas-container:active {
    cursor: grabbing;
}

.wp-tactical-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 16px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wp-tactical-zoom-controls button {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid #334155;
    color: #f8fafc;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.15s;
}

.wp-tactical-zoom-controls button:hover {
    background: #1e293b;
    border-color: #f59e0b;
}

.wp-tactical-footer-coords {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 30;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 11px;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
}

.wp-tactical-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
    transition: transform 0.15s ease;
}

.wp-tactical-marker:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 35;
}

.wp-tactical-marker-inner {
    width: 38px;
    height: 38px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 8px;
    border: 2px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

@keyframes wpPulseRing {
    0% { transform: scale(0.9); opacity: 0.9; }
    50% { transform: scale(1.7); opacity: 0.3; }
    100% { transform: scale(2.4); opacity: 0; }
}

.wp-tactical-pulse-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    pointer-events: none;
    animation: wpPulseRing 2.2s infinite;
    background: rgba(245, 158, 11, 0.25);
}

.wp-tactical-callsign {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    font-family: monospace;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid #334155;
    border-radius: 4px;
    color: #f8fafc;
}

/* Modals */
.wp-tactical-modal-backdrop,
.wp-tactical-layers-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wp-tactical-modal-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    color: #f8fafc;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Mobile & Tablet Layers Modal */
.wp-tactical-layers-modal-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    color: #f8fafc;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.wp-tactical-layers-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #334155;
    background: rgba(2, 6, 23, 0.6);
}

.wp-layers-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.wp-tactical-layers-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wp-layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wp-layer-item:hover {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
}

.wp-layer-item.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.wp-layer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-layer-icon {
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
    border-radius: 6px;
    border: 1px solid #334155;
}

.wp-layer-title {
    font-size: 12px;
    font-weight: bold;
    color: #f8fafc;
}

.wp-layer-desc {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.wp-layer-switch {
    width: 36px;
    height: 20px;
    background: #1e293b;
    border-radius: 20px;
    position: relative;
    transition: background 0.2s;
}

.wp-layer-knob {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.wp-layer-item.active .wp-layer-switch {
    background: #f59e0b;
}

.wp-layer-item.active .wp-layer-knob {
    transform: translateX(16px);
}

.wp-tactical-layers-modal-footer {
    padding: 12px 16px;
    background: #020617;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: flex-end;
}

.wp-layers-apply-btn {
    width: 100%;
    background: #f59e0b;
    color: #020617;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 640px) {
    .wp-tactical-modal-backdrop,
    .wp-tactical-layers-modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }
    .wp-tactical-modal-card,
    .wp-tactical-layers-modal-card {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 82vh;
        animation: wpSlideUp 0.3s ease-out;
    }
}

@keyframes wpSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Roster Drawer */
.wp-tactical-roster-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85%;
    background: rgba(15, 23, 42, 0.96);
    border-left: 1px solid #334155;
    z-index: 40;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease-in-out;
}

.wp-tactical-roster-header {
    padding: 14px 16px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wp-tactical-roster-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wp-tactical-roster-item {
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wp-tactical-roster-item:hover {
    background: #1e293b;
    border-color: #f59e0b;
}

/* Floating Toolbar for Frontline/Area Drawing */
.wp-tactical-frontline-bar {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    font-size: 12px;
    color: #f8fafc;
}

/* Floating Placement Banner */
.wp-tactical-placement-banner {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: #f59e0b;
    color: #020617;
    font-weight: bold;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 12px;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
    animation: wpBounce 1.5s infinite;
}

@keyframes wpBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -6px); }
}

/* Icon picker and color palette in Admin */
.wp-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    padding: 6px;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 6px;
}

.wp-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
}

.wp-icon-btn:hover, .wp-icon-btn.active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #1e293b;
}

.wp-color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s;
}

.wp-color-btn:hover, .wp-color-btn.active {
    transform: scale(1.2);
    border-color: #ffffff;
}
