/* ========================================
   RESETEO Y ESTILOS BASE
======================================== */
body.geoint-body {
    padding: 0;
    background: #0b1622;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================
   HEADER
======================================== */
.geoint-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: #102235;
    border-bottom: 2px solid #ffffff;
    padding: 20px 40px;
    gap: 20px;
}

.header-logo img {
    width: 130px;
    height: auto;
}

.header-center {
    text-align: center;
    flex: 1;
    min-width: 260px;
}

.header-center h1,
.header-center h2,
.header-center h3 {
    margin: 5px 0;
    color: #ffffff;
    word-wrap: break-word;
}

/* ========================================
   TÍTULOS GLOBALES
======================================== */
.section-title,
.status-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 18px;
    color: #ffffff;
}

/* ========================================
   PANEL DE ESTADO DEL SISTEMA
======================================== */
.system-status-panel {
    background: #13283d;
    margin: 20px;
    padding: 20px;
    border: 1px solid #ffffff;
    border-radius: 12px;
    overflow-x: auto;
    width: calc(100% - 40px);
}

.status-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 5px;
}

.status-card {
    min-width: 120px;
    max-width: 180px;
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex: 0 0 auto;
    text-align: center;
    background: #1a3550;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: red;
}

.status-card.online .status-dot {
    background: #00ff66;
    box-shadow: 0 0 10px #00ff66;
}

.status-card.offline .status-dot {
    background: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

/* ========================================
   SECCIONES DE MAPA Y STREETVIEW
======================================== */
.map-section,
.streetview-section,
.context-panel {
    background: #13283d;
    margin: 20px;
    padding: 22px;
    border: 1px solid #ffffff;
    border-radius: 12px;
    width: calc(100% - 40px);
}

#geoint-map,
#street-view {
    width: 100%;
    height: 720px !important;
    min-height: 720px !important;
    background: #0d1c2b;
    border: 2px solid #ffffff22;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
}

/* ========================================
   PANEL DE CONTEXTO E IA
======================================== */
.context-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.context-card {
    background: #1a3550;
    border: 1px solid #ffffff;
    border-radius: 12px;
    padding: 18px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.context-card label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 14px;
}

.context-card textarea,
.context-card select,
.context-card input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #0d1c2b;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: 0.2s ease;
}

.context-card textarea:focus,
.context-card select:focus,
.context-card input:focus {
    border-color: #00bfff;
}

.context-card textarea {
    min-height: 220px;
    max-height: 260px;
    resize: vertical;
    line-height: 1.5;
}

.context-card input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.ia-placeholder {
    background: #0d1c2b;
    border: 1px dashed #ffffff;
    padding: 24px;
    text-align: center;
    border-radius: 8px;
    width: 100%;
    overflow-wrap: break-word;
}

/* ========================================
   PANEL DE EVIDENCIAS
======================================== */
#evidence-panel {
    margin-top: 20px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.evidence-item {
    background: #0b1622;
    border: 1px solid #00ff88;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

.evidence-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: white;
    flex: 1;
    min-width: 180px;
    overflow-wrap: break-word;
}

.evidence-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.evidence-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.evidence-context-btn {
    background: #0077cc;
    color: white;
}

.evidence-remove-btn {
    background: #cc0000;
    color: white;
}

/* ========================================
   BOTONES Y ACCIONES GLOBALES
======================================== */
.report-actions,
.validation-actions,
.ia-response-actions {
    margin-top: 25px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.validation-container {
    margin-top: 20px;
    width: 100%;
}

button {
    border: none;
    outline: none;
}

.reject-btn,
.accept-btn,
.generate-btn,
.ia-suggestion-btn,
#accept-ia-suggestion,
#reject-ia-suggestion {
    width: 320px;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: nowrap;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    padding: 0 20px;
}

.reject-btn,
#reject-ia-suggestion {
    background: #8b0000;
}

.reject-btn:hover,
#reject-ia-suggestion:hover {
    transform: translateY(-2px);
}

.accept-btn,
#accept-ia-suggestion {
    background: #006400;
}

.accept-btn:hover,
#accept-ia-suggestion:hover {
    transform: translateY(-2px);
}

.generate-btn {
    background: #003366;
    border: 1px solid #ffffff;
}

.generate-btn:hover {
    background: #00509e;
    transform: translateY(-2px);
}

.ia-suggestion-btn {
    background: #0f766e;
    border: 1px solid #ffffff;
}

.ia-suggestion-btn:hover {
    background: #14b8a6;
    transform: translateY(-2px);
}

/* ========================================
   MODAL DE INTELIGENCIA ARTIFICIAL
======================================== */
.ia-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    padding: 20px;
}

.ia-modal-content {
    background: #13283d;
    margin: auto;
    padding: 30px;
    width: 100%;
    max-width: 1100px;
    border: 2px solid #00ff88;
    border-radius: 12px;
    color: white;
}

.ia-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#close-ia-modal {
    background: red;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 6px;
}

#ia-response-content {
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 15px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-wrap: break-word;
}

.ia-loading {
    display: none;
    color: #00ff88;
    font-weight: bold;
    margin-bottom: 20px;
}

.ia-section-tittle {
    color: #00ff88;
    font-size: 16px;
    font-weight: bold;
    margin-top: 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 136, 3);
    padding-bottom: 4px;

}

/* ========================================
   CONTEXTUALIZACIÓN DE EVIDENCIA
======================================== */

.context-form{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.context-field{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.context-field label{
    font-size:13px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#00ff88;
    margin-bottom:4px;
}

#evidence-file-name{
    background:#0d1c2b;
    border:1px solid rgba(255,255,255,.15);
    border-radius:8px;
    padding:12px;
    color:#ffffff;
    font-size:14px;
    word-break:break-word;
}

.context-field textarea{
    width:100%;
    min-height:140px;
    padding:14px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.15);
    background:#0d1c2b;
    color:#ffffff;
    font-size:14px;
    resize:vertical;
    line-height:1.6;
}

.context-field textarea:focus{
    outline:none;
    border-color:#00bfff;
    box-shadow:0 0 8px rgba(0,191,255,.25);
}

#save-evidence-context{
    align-self:flex-end;
    padding:14px 24px;
    background:#006400;
    color:white;
    border:none;
    border-radius:10px;
    font-weight:bold;
    cursor:pointer;
    transition:.2s ease;
}

#save-evidence-context:hover{
    transform:translateY(-2px);
}

/* ========================================
   VISTA DE REPORTE GEOINT 8.X
======================================== */
#report-view {
    min-height: 100vh;
    background: #0b1220;
    color: white;
    display: none;
}

.report-view-active {
    display: flex !important;
    flex-wrap: wrap;
}

.bottom-report-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px;
    align-items: flex-start;
}

.report-sidebar {
    width: 320px;
    min-width: 280px;
    max-width: 100%;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}

.report-sidebar-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
    color: #60a5fa;
}

.report-nav-btn {
    width: 100%;
    margin-bottom: 12px;
    padding: 14px;
    background: #1e293b;
    border: none;
    color: white;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    word-break: break-word;
}

.report-nav-btn:hover {
    background: #2563eb;
}

.print-report-btn {
    width: 100%;
    margin-top: 30px;
    padding: 16px;
    background: #dc2626;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.print-report-btn:hover {
    transform: translateY(-2px);
}

.report-content {
    flex: 1;
    min-width: 0;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 25px;
    overflow-x: auto;
}


.report-preview-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 25px;
    word-wrap: break-word;
}

.report-preview-body {
    background: #1e293b;
    min-height: 700px;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #334155;
    overflow-wrap: break-word;
}

/* ========================================
   MEDIA QUERIES (RESPONSIVE)
======================================== */
@media (max-width: 1200px) {
    .context-grid {
        grid-template-columns: 1fr !important;
    }

    .report-sidebar,
    .report-content {
        width: 100%;
    }

    #geoint-map,
    #street-view {
        height: 500px !important;
        min-height: 500px !important;
    }
}

@media (max-width: 768px) {
    .geoint-header {
        justify-content: center;
        text-align: center;
        padding: 20px;
    }

    .header-logo img {
        width: 100px;
    }

    .map-section,
    .streetview-section,
    .context-panel,
    .system-status-panel {
        margin: 12px;
        width: calc(100% - 24px);
        padding: 16px;
    }

    .context-card {
        padding: 16px;
    }

    .reject-btn,
    .accept-btn,
    .generate-btn,
    .ia-suggestion-btn,
    #accept-ia-suggestion,
    #reject-ia-suggestion {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
    }

    #geoint-map,
    #street-view {
        height: 380px !important;
        min-height: 380px !important;
    }

    .report-content,
    .report-preview-body {
        padding: 18px;
    }
}

/* ========================================
   CONTEXTUALIZACIÓN IA
======================================== */

.context-meter-container {
    margin-top: 12px;
    width: 100%;
}

.context-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px; 
    font-size: 13px;
    font-weight: bold;
    color : #ffffff;
}

.context-meter-bar {
    width: 100%;
    height: 12px;
    background: #0d1c2b;
    border-radius: 999px;
    overflow: hidden;
}

#context-meter-fill, 
#evidence-context-fill {
    height: 100%;
    width: 0%;
    transition: all .3s ease;
    border-radius: 999px;
    background: #ff0000;
}

.context-feedback {
    margin-top: 8px;
    font-size: 12px;
    color: #d1d5db;
    line-height: 1.4;
}

/* =====================================================
   IA GEOINT - REFINAMIENTO POR BLOQUES
===================================================== */

.ia-response-summary{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;

    margin-bottom:25px;
    padding:18px;

    border:1px solid rgba(255,255,255,.15);
    border-radius:12px;

    background:#0d1c2b;
}

.ia-response-summary-title{
    font-size:22px;
    font-weight:700;
    color:#00ff88;
}

.ia-response-summary-meta{
    font-size:13px;
    color:#cbd5e1;
}

.ia-blocks-container{
    display:flex;
    flex-direction:column;
    gap:18px;
}

/* =====================================================
   TARJETA
===================================================== */

.ia-block-card{
    background:#102235;

    border:2px solid rgba(255,255,255,.08);

    border-radius:14px;

    padding:18px;

    transition:.25s ease;

    cursor:pointer;
}

.ia-block-card:hover{
    border-color:#00bfff;

    transform:translateY(-2px);

    box-shadow:
        0 8px 20px rgba(0,0,0,.35);
}

.ia-block-card.is-active{
    border-color:#00ff88;

    box-shadow:
        0 0 0 2px rgba(0,255,136,.25);
}

/* =====================================================
   HEADER
===================================================== */

.ia-block-card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;

    margin-bottom:15px;
}

.ia-block-card-title{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.ia-block-chip{
    background:#00ff88;
    color:#000;

    font-weight:700;

    padding:6px 10px;

    border-radius:999px;

    font-size:12px;
}

.ia-block-section{
    font-size:15px;
    font-weight:700;
    color:white;
}

.ia-block-status-tag{
    font-size:12px;

    padding:6px 10px;

    border-radius:999px;

    background:#1f2937;
}

/* =====================================================
   BODY
===================================================== */

.ia-block-card-body{
    line-height:1.8;
    color:#f1f5f9;

    white-space:normal;

    font-size:14px;
}

/* =====================================================
   ACCIONES
===================================================== */

.ia-block-card-actions{
    margin-top:20px;

    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.ia-block-card-actions button{
    border:none;

    padding:10px 16px;

    border-radius:8px;

    cursor:pointer;

    font-weight:700;

    text-align:center;

}

button[data-block-action="keep"]{
    background:#006400;
    color:white;
}

button[data-block-action="revise"]{
    background:#003366;
    color:white;
}

/* =====================================================
   PANEL DE REVISIÓN
===================================================== */

.ia-block-feedback-panel{
    margin-top:20px;

    padding:16px;

    border-radius:12px;

    background:#0b1622;

    border:1px solid rgba(255,255,255,.08);
}

.ia-block-feedback-label{
    display:block;

    margin-bottom:10px;

    color:#00ff88;

    font-weight:700;
}

.ia-block-feedback-input{
    width:100%;

    min-height:140px;

    resize:vertical;

    padding:14px;

    border-radius:10px;

    background:#07111d;

    color:white;

    border:1px solid rgba(255,255,255,.15);
}

.ia-block-feedback-input:focus{
    outline:none;

    border-color:#00bfff;
}

.ia-block-feedback-actions{
    margin-top:15px;

    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

button[data-block-action="submit-revision"]{
    background:#006400;
    color:white;
}

button[data-block-action="cancel-revision"]{
    background:#8b0000;
    color:white;
}

.ia-block-feedback-note{
    margin-top:12px;

    font-size:12px;

    color:#94a3b8;
}

/* =====================================================
   ESTADOS
===================================================== */

.ia-block-status-kept{
    border-left:6px solid #22c55e;
}

.ia-block-status-revised{
    border-left:6px solid #38bdf8;
}

.ia-block-status-editing{
    border-left:6px solid #f59e0b;
}

.ia-block-status-pending{
    border-left:6px solid #64748b;
}

.ia-block-revision-result{
    margin-top:14px;

    padding:12px;

    border-radius:10px;

    background:#07111d;

    border:1px solid rgba(255,255,255,.08);
}

.ia-empty-state{
    padding:40px;

    text-align:center;

    border:1px dashed rgba(255,255,255,.20);

    border-radius:12px;

    color:#94a3b8;
}
