/* ============================================================
   LAYOUT BASE PADRÃO FORENSYS (MATCH COM CHATVIEWER)
============================================================ */
.page {
    display: flex;
    height: 85vh;
    min-height: 600px;
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* ============================================================
   SIDEBAR — IGUAL AO CHATVIEWER
============================================================ */
.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: #2c3e50;
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.upload-section {
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.form-group {
    margin-bottom: 15px;
}

.upload-section label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #2c3e50;
}

.upload-section input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
}

.upload-section input[type="radio"] {
    transform: scale(1.1);
    margin-right: 6px;
    margin-left: 10px;
}

/* ============================================================
   BOTÕES PRINCIPAIS - CORRIGIDOS
============================================================ */
.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    margin-top: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #2980b9;
    text-decoration: none;
    color: white;
}

/* BOTÃO LIMPAR/NOVA ANÁLISE */
.analysis-panel {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

.btn-clear {
    display: block;
    width: 100%;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: #c0392b;
    text-decoration: none;
    color: white;
}

/* ============================================================
   MAIN AREA — PADRÃO CHATVIEWER
============================================================ */
.main-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #fafafa;
}

/* Empty state */
.empty-state {
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* ============================================================
   PROGRESSO REAL
============================================================ */
.progress-container {
    background: white;
    border-radius: 10px;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #ececec;
    animation: fadeIn 0.5s ease;
}

.progress-container h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.progress-bar {
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4e73df, #224abe);
    border-radius: 12px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   UPLOAD SUCCESS BAR (BOTÕES DE DOWNLOAD/PDF CORRIGIDOS)
============================================================ */
.upload-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-counter {
    color: #155724;
    font-weight: 600;
    font-size: 1.1rem;
}

.upload-actions {
    display: flex;
    gap: 10px;
}

.top-btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.top-btn.txt {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.top-btn.txt:hover {
    background: #0056b3;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.top-btn.pdf {
    background: #dc3545;
    color: white;
    border-color: #bd2130;
}

.top-btn.pdf:hover {
    background: #bd2130;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* ============================================================
   TABELAS - UMA EMBAIXO DA OUTRA
============================================================ */
.tables {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
}

.card h3 {
    color: #1565c0;
    border-bottom: 2px solid #bbdefb;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3::before {
    content: "📋";
    font-size: 1.2rem;
}

.card:nth-child(1) h3::before { content: "🎬"; }
.card:nth-child(2) h3::before { content: "🔄"; }
.card:nth-child(3) h3::before { content: "🔐"; }

.card table {
    width: 100%;
    border-collapse: collapse;
}

.card table th {
    text-align: left;
    padding: 12px 15px;
    background-color: rgba(187, 222, 251, 0.3);
    color: #0d47a1;
    font-weight: 600;
    width: 35%;
    border-right: 1px solid #bbdefb;
}

.card table td {
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.7);
    color: #333;
    border-bottom: 1px solid #e3f2fd;
}

.card table tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.9);
}

.card table tr:last-child td {
    border-bottom: none;
}

/* Estilo especial para a tabela de hashes */
.card:nth-child(3) table th {
    width: 20%;
}

.card:nth-child(3) table td {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* ============================================================
   RESPONSIVIDADE
============================================================ */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .tables {
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card table th,
    .card table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .card table th {
        width: 40%;
    }
    
    .upload-success {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .upload-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   ANIMAÇÕES
============================================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }


/* Estilos para as barras de progresso - melhorados */
.progress-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.progress-step {
    margin-bottom: 15px;
}

.progress-step:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.progress-label .percent {
    font-weight: bold;
    color: #1565c0;
}

.progress-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4e73df, #224abe);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0.0, 0.2, 1); /* Transição suave */
    position: relative;
    min-width: 0%;
}

/* Animação de carregamento para quando estiver em progresso */
.progress-fill.uploading::after,
.progress-fill.converting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-pending { background: #ffc107; }
.status-uploading { background: #17a2b8; }
.status-converting { background: #007bff; }
.status-complete { background: #28a745; }
.status-error { background: #dc3545; }