@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0f766e;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --dark-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(226, 232, 240, 0.8);
    --radius-xl: 20px;
    --radius-lg: 14px;
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 15px 35px -5px rgba(13, 148, 136, 0.3);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f1f5f9;
    background-image: 
        radial-gradient(at 0% 0%, rgba(13, 148, 136, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(5, 150, 105, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: #1e293b;
    min-height: 100vh;
    padding-bottom: 90px;
}

/* Mobile Container Frame for Desktop View */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px 12px;
}

/* Top App Header Banner */
.app-banner-wrap {
    width: 100%;
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 6px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    margin-bottom: 16px;
    overflow: hidden;
    text-align: center;
}

.app-banner-img {
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    border-radius: 14px;
    display: block;
}

.app-header {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: 14px 18px;
    color: white;
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Slick Form Cards */
.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 22px 18px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

/* Stacking Context Hierarchy for Form Cards & Floating Dropdowns */
#card_ubicacion_objeto,
#contenedor_formulario_completo > .form-card:nth-child(1) {
    z-index: 40 !important;
}

#card_detalle_dano,
#contenedor_formulario_completo > .form-card:nth-child(2) {
    z-index: 30 !important;
}

#card_evidencia_foto,
#contenedor_formulario_completo > .form-card:nth-child(3) {
    z-index: 20 !important;
}

#card_datos_reporta,
#contenedor_formulario_completo > .form-card:nth-child(4) {
    z-index: 10 !important;
}

.form-card:focus-within,
.form-card.has-open-dropdown {
    z-index: 100 !important;
}

.form-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
}

.form-card-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Custom Input & Select2 Styling */
.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 6px;
}

.form-control, .form-select {
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1.5px solid #cbd5e1;
    background-color: #f8fafc;
    transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Select2 Enhancements */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: var(--radius-lg) !important;
    min-height: 48px !important;
    padding: 8px 12px !important;
    font-size: 0.95rem !important;
    border: 1.5px solid #cbd5e1 !important;
    background-color: #f8fafc !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px var(--accent-glow) !important;
}

.select2-dropdown {
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--card-border) !important;
    z-index: 1060 !important;
}

/* Camera & Photo Input Section */
.camera-box {
    background: #0f172a;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #334155;
}

.camera-preview-video {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: none;
    border-radius: var(--radius-lg);
}

.camera-preview-img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: none;
    border-radius: var(--radius-lg);
    background: #000;
}

.camera-placeholder {
    padding: 30px 20px;
    color: #94a3b8;
}

.camera-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.camera-actions {
    display: flex !important;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-camera {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 calc(33.333% - 6px);
    min-width: 95px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-camera:active {
    transform: scale(0.96);
}

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

.btn-camera-success {
    background: #10b981;
    color: white;
}

.btn-camera-danger {
    background: #ef4444;
    color: white;
}

/* Floating Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 580px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1050;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
}

.nav-item-btn i {
    font-size: 1.25rem;
}

.nav-item-btn.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* Primary Action Submit Button */
.btn-submit-main {
    background: var(--primary-gradient);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-glow);
    transition: all 0.25s ease;
}

.btn-submit-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -5px rgba(13, 148, 136, 0.45);
}

.btn-submit-main:active {
    transform: scale(0.98);
}

/* Success Radial Checkmark & Celebration Modal */
.radicado-badge {
    background: #ecfdf5;
    border: 2px dashed #059669;
    color: #065f46;
    border-radius: var(--radius-lg);
    padding: 14px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: center;
    margin: 15px 0;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: #059669;
    font-size: 2.8rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Status Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-en-revision { background: #e0f2fe; color: #075985; }
.badge-en-proceso { background: #ddd6fe; color: #5b21b6; }
.badge-atendido { background: #d1fae5; color: #065f46; }
.badge-rechazado { background: #fee2e2; color: #991b1b; }

/* Custom Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner-custom {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Views display toggle */
.app-view {
    display: none;
}
.app-view.active {
    display: block;
    animation: fadeInView 0.3s ease-in-out;
}

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

/* ========================================================
   TIPO DE REPORTE SELECTOR (LOCATIVO VS EQUIPO)
   ======================================================== */
.tipo-reporte-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .tipo-reporte-grid {
        grid-template-columns: 1fr;
    }
}

.tipo-reporte-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.tipo-reporte-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

.tipo-reporte-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.18);
}

.tipo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.tipo-reporte-card.active .tipo-icon {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

.tipo-info {
    flex: 1;
    min-width: 0;
}

.tipo-title {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.25;
}

.tipo-reporte-card.active .tipo-title {
    color: var(--primary);
}

.tipo-desc {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.2;
    margin-top: 3px;
}

.tipo-check {
    font-size: 1.2rem;
    color: #cbd5e1;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.tipo-reporte-card.active .tipo-check {
    color: var(--primary);
}

/* ========================================================
   SELECCIÓN Y BÚSQUEDA DE EQUIPO
   ======================================================== */
.equipo-section {
    position: relative;
    z-index: 50;
    animation: fadeInView 0.25s ease-out;
}

.equipo-search-box {
    position: relative;
    z-index: 100;
}

.equipo-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999 !important;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    margin-top: 6px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28), 0 0 1px rgba(0, 0, 0, 0.2);
}

.equipo-dropdown-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

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

.equipo-dropdown-item:hover,
.equipo-dropdown-item.active {
    background: #f0fdf4;
}

.equipo-item-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.equipo-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.badge-rotulo {
    background: #0d9488;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-codi {
    background: #334155;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-grupo {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 6px;
}

/* Tarjeta de Equipo Seleccionado */
.card-equipo-selected {
    background: #ecfdf5;
    border: 2px solid #10b981;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.equipo-badge-icon {
    width: 38px;
    height: 38px;
    background: #10b981;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* ========================================================
   BARCODE SCANNER VIEWPORT MODAL
   ======================================================== */
.scanner-viewport-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 290px;
    margin: 0 auto;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.scanner-reader-box {
    width: 100% !important;
    height: 100% !important;
    position: relative;
}

.scanner-reader-box video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 14px;
}

/* High-tech Laser Line */
.scanner-laser-line {
    position: absolute;
    top: 10%;
    left: 8%;
    right: 8%;
    height: 3px;
    background: #22c55e;
    box-shadow: 0 0 14px #22c55e, 0 0 24px #4ade80;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
    animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
    0% { top: 12%; opacity: 0.8; }
    50% { opacity: 1; }
    100% { top: 88%; opacity: 0.8; }
}

/* Viewfinder Target Corners */
.scanner-corners {
    position: absolute;
    top: 14%;
    left: 10%;
    right: 10%;
    bottom: 14%;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    pointer-events: none;
    z-index: 9;
}

.scanner-corners::before {
    content: '';
    position: absolute;
    top: -3px; left: -3px;
    width: 20px; height: 20px;
    border-top: 4px solid #22c55e;
    border-left: 4px solid #22c55e;
    border-top-left-radius: 8px;
}

.scanner-corners::after {
    content: '';
    position: absolute;
    bottom: -3px; right: -3px;
    width: 20px; height: 20px;
    border-bottom: 4px solid #22c55e;
    border-right: 4px solid #22c55e;
    border-bottom-right-radius: 8px;
}

/* ========================================================
   TEAL BUTTONS & BARCODE SCANNER BUTTON
   ======================================================== */
.btn-teal {
    background: var(--primary-gradient) !important;
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
    transition: all 0.2s ease;
}

.btn-teal:hover, .btn-teal:focus, .btn-teal:active {
    background: linear-gradient(135deg, #0f766e 0%, #047857 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.45);
    transform: translateY(-1px);
}

.btn-outline-teal {
    color: var(--primary) !important;
    border: 1.5px solid var(--primary) !important;
    background: transparent !important;
}

.btn-outline-teal:hover {
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
}

/* Botón de Escanear Código de Barras (Solo Icono para Maximizar Espacio en Móvil) */
#btnScanBarcode {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%) !important;
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    min-width: 52px !important;
    padding: 0 !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35) !important;
    flex-shrink: 0 !important;
    z-index: 5;
    transition: all 0.2s ease;
}

#btnScanBarcode:hover {
    background: linear-gradient(135deg, #0f766e 0%, #047857 100%) !important;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5) !important;
    transform: translateY(-1px);
}

#btnScanBarcode:active {
    transform: scale(0.96);
}

.barcode-icon-svg {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

