/* ============================================================
   ARQUEOHABILIS CAMPO - ESTILOS DEL MOTOR DE FOTOMAPEO TÁCTIL
   Diseñado para luz solar directa, ergonomía de trinchera y uso táctil
   ============================================================ */

/* Contenedor Principal del Visor */
.fotomapeo-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height, 56px) - var(--nav-height, 64px) - var(--safe-bottom, 0px) - 104px);
    height: calc(100dvh - var(--header-height, 56px) - var(--nav-height, 64px) - var(--safe-bottom, 0px) - 104px);
    min-height: 360px;
    display: flex;
    flex-direction: column;
    background: #06090e;
    overflow: hidden;
}

/* Barra superior de información rápida de la planta */
.fotomapeo-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.planta-badge-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.planta-meta-pill {
    background: rgba(234, 88, 12, 0.2);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: #f97316;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Estado Vacío: Cámara Gigante de Campo */
.fotomapeo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 20px 18px 28px;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
}

.btn-camara-gigante {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.5);
    color: #ffffff;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 20px;
    animation: pulsoCamara 2.2s infinite ease-in-out;
}

@keyframes pulsoCamara {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.6); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(234, 88, 12, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.empty-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    max-width: 320px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.empty-selectors {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 16px;
}

.empty-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Área del Canvas Táctil */
.contenedor-canvas-fotomapeo {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    background: #090d16;
}

#canvas-fotomapeo {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Barra de Herramientas Táctiles Flotante (Dock Inferior) */
.fotomapeo-toolbar {
    position: absolute;
    bottom: 66px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 20;
}

.btn-tool-tactil {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 1.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tool-tactil.active {
    background: #f97316;
    border-color: #ffffff;
    color: #ffffff;
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.5);
}

/* Paleta de Colores de Dibujo Flotante */
.fotomapeo-palette {
    position: absolute;
    bottom: 128px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 19;
}

.color-chip-tactil {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-chip-tactil.active {
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Carrusel de Pines Inferior */
.fotomapeo-pines-strip {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    padding: 0 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    z-index: 15;
    scrollbar-width: none;
}

.fotomapeo-pines-strip::-webkit-scrollbar {
    display: none;
}

.pin-card-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 6px 12px;
    color: #ffffff;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.pin-card-item.selected {
    border-color: #f97316;
    background: rgba(234, 88, 12, 0.2);
}

.pin-card-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffffff;
}

.pin-card-name {
    font-size: 0.82rem;
    font-weight: 700;
}

.pin-card-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Bottom Sheet de Pin Táctil */
.pin-tactil-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: #0f172a;
    border-top: 2px solid #f97316;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2100;
    padding: 16px 20px calc(30px + var(--safe-bottom, 0px));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.pin-tactil-sheet.open {
    transform: translateY(0);
}

.pin-sheet-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin: 0 auto 12px;
}

.pin-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.pin-sheet-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
}

.pin-sheet-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.pin-sheet-close {
    background: #1e293b;
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones de Categoría Circulares */
.cat-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.btn-cat-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: #1e293b;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cat-pin i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.btn-cat-pin span {
    font-size: 0.72rem;
    font-weight: 700;
}

.btn-cat-pin.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: currentColor;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Control Z (Profundidad) Táctil */
.z-control-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
}

.z-btn-step {
    background: #334155;
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.z-btn-step:active {
    background: #f97316;
}

.z-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.z-input-field {
    width: 60px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: right;
}

/* BOTÓN GIGANTE WALKIE-TALKIE IA */
.btn-walkie-talkie-ia {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
    transition: all 0.25s ease;
    margin-bottom: 12px;
}

.btn-walkie-talkie-ia:active {
    transform: scale(0.98);
}

.btn-walkie-talkie-ia.recording {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
    animation: grabacionPulso 1.2s infinite ease-in-out;
}

@keyframes grabacionPulso {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pin-sheet-desc-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    min-height: 60px;
    resize: none;
    margin-bottom: 12px;
}

.pin-sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.btn-pin-action-del {
    flex: 1;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-pin-action-ok {
    flex: 2;
    background: #10b981;
    border: none;
    color: #ffffff;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}

