:root {
    --bg-color: #0A1128;
    --panel-bg: rgba(15, 23, 42, 0.5);
    --text-color: #F8FAFC;
    --text-muted: #94A3B8;
    --primary: #00E5FF;
    --primary-hover: #00B8D4;
    --border-color: rgba(0, 229, 255, 0.15);
    --success: #10B981;
    --danger: #FF1744;
    --warning: #F59E0B;
    --diff-add: rgba(255, 23, 68, 0.2); 
    --diff-remove: rgba(16, 185, 129, 0.2);
    --font-main: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.05) 0%, transparent 50%);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.cyber-header {
    height: 70px;
    background: rgba(10, 17, 40, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: baseline;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    letter-spacing: -1px;
}

.subtitle {
    color: var(--primary);
    font-size: 0.9rem;
    margin-left: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Upload Section Modal / Overlay initially */
#uploadOverlay {
    position: fixed;
    top: 70px; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(10,17,40,0.95) 0%, #0A1128 100%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.results-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    height: 100%;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 900px;
    width: 100%;
    margin-bottom: 2rem;
}

.drop-zone {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(0, 229, 255, 0.3);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0,229,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-zone:hover::before, .drop-zone.dragover::before {
    opacity: 1;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 229, 255, 0.2);
}

.drop-zone .icon { font-size: 3rem; margin-bottom: 1rem; }
.drop-zone span { color: var(--primary); text-decoration: underline; }
.file-name { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); word-break: break-all; }

.btn-primary {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.loader {
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hidden { display: none !important; }

/* Forensic Workbench Layout */
.workbench {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
}

.panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Panel Left: Inspector */
.panel-left {
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
}

/* Panel Right: Console & Evidence */
.panel-right {
    background: var(--panel-bg);
    border-left: 1px solid var(--border-color);
}

/* Panel Headers */
.panel-header {
    background: #0f172a;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Components within Panels */
.widget {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge.success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.hash-text {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 5px;
}

.meta-list {
    list-style: none;
    font-size: 0.85rem;
}
.meta-list li {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}
.meta-list li strong { color: var(--text-muted); font-weight: normal; }

/* Document Viewer (Center) */
.doc-viewer {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #0b0f19; /* Darkest background for center */
}

/* Paper simulation for Diff */
.diff-container {
    background: #ffffff;
    color: #111827;
    padding: 3rem 4rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 4px;
    position: relative;
    border-top: 15px solid #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-add {
    background-color: var(--diff-add);
    color: #991b1b; /* Red text for added/fake */
    text-decoration: none;
    font-weight: bold;
}

.diff-remove {
    background-color: var(--diff-remove);
    color: #065f46; /* Green text for original/removed */
    text-decoration: line-through;
}

/* Right Panel Elements */
.terminal-box {
    background: #000;
    color: #34d399;
    font-family: monospace;
    font-size: 0.75rem;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    max-height: 200px;
    white-space: pre-wrap;
    border: 1px solid #1f2937;
}

.terminal-box.danger { color: #fca5a5; }

/* Veredicto Modal / Top Bar */
.verdict-banner {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-download {
    background: var(--success);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.3s;
}
.btn-download:hover { background: #059669; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* =========================================
   HUELLADOC 3.0: EXACT MOCKUP MATCH
   ========================================= */

/* Verdict Ring */
.verdict-ring {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
}

.verdict-ring.altered {
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(255, 23, 68, 0.4), inset 0 0 40px rgba(255, 23, 68, 0.2);
}

.verdict-ring.intact {
    border-color: var(--success);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4), inset 0 0 40px rgba(16, 185, 129, 0.2);
}

.verdict-ring.altered #verdictTitle { color: var(--danger); text-shadow: 0 0 10px rgba(255, 23, 68, 0.8); }
.verdict-ring.intact #verdictTitle { color: var(--success); text-shadow: 0 0 10px rgba(16, 185, 129, 0.8); }

.verdict-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Cards Layout */
.cards-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 1300px;
}

/* Cyber Card (Matches Mockup) */
.cyber-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.cyber-card.cyan-glow {
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.1), inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.cyber-card.red-glow {
    border-color: rgba(255, 23, 68, 0.5);
    box-shadow: 0 0 20px rgba(255, 23, 68, 0.1), inset 0 0 20px rgba(255, 23, 68, 0.05);
}

/* Card Header (Icon + Info) */
.card-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.card-icon-box {
    width: 80px;
    height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.cyan-glow .card-icon-box { color: var(--primary); }
.red-glow .card-icon-box { color: var(--danger); }

.card-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.card-meta-row {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
}

.meta-label { color: var(--text-muted); width: 110px; }
.meta-value { color: #fff; font-weight: 500; font-family: var(--font-main); flex: 1; }
.meta-value.mono { font-family: var(--font-mono); font-size: 0.85rem; color: #cbd5e1; }

/* Divider */
.card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

/* Alteration Status */
.alt-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Visual Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Progress Bar */
.prog-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.prog-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.cyan-glow .prog-bar-fill { background: var(--primary); width: 100%; box-shadow: 0 0 10px var(--primary); }
.red-glow .prog-bar-fill { background: var(--danger); width: 78%; box-shadow: 0 0 10px var(--danger); }

/* Hash Footer */
.hash-footer {
    margin-top: auto;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #94a3b8;
}

/* =========================================
   TIMELINE MODAL (VERSION HISTORY)
   ========================================= */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 20px;
}

.timeline-item {
    position: relative;
    padding: 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-left: 15px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #475569;
}

.timeline-item.insercion::before {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.timeline-item.eliminacion::before {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timeline-author {
    color: #fff;
    font-weight: 600;
}

.timeline-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    word-break: break-all;
}

.timeline-item.insercion .timeline-text {
    color: #a7f3d0;
    border-left: 3px solid var(--primary);
}

.timeline-item.eliminacion .timeline-text {
    color: #fecaca;
    border-left: 3px solid var(--danger);
    text-decoration: line-through;
}

.btn-timeline {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
}
.btn-timeline:hover {
    background: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .cards-layout {
        grid-template-columns: 1fr;
    }
}
