/* ============================================================
   LAYOUT BASE PADRÃO FORENSYS (MATCH COM CHATVIEWER E VIDEO TOOLS)
============================================================ */
.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 AOS OUTROS PROJETOS
============================================================ */
.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: #0D6EFD;
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.sidebar-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.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;
}

/* Informações do arquivo */
.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 6px;
    display: none;
}

/* ============================================================
   OPÇÕES DE COMPRESSÃO
============================================================ */
.compressor-options {
    margin-top: 20px;
}

.compressor-options h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.option-group {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.option-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.option-group label span {
    flex: 1;
}

/* Seletor de método */
.method-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.method-option:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.method-option input[type="radio"] {
    margin-right: 10px;
}

.method-label {
    flex: 1;
}

.method-label strong {
    display: block;
    color: #2c3e50;
}

.method-label small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Controles DPI */
.dpi-control, .quality-slider-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 8px;
}

.dpi-control label, .quality-slider-container label {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 10px;
}

.dpi-value, .quality-value {
    color: #007bff;
    font-weight: bold;
}

/* Sliders */
.dpi-slider, .quality-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #dee2e6;
    border-radius: 4px;
    outline: none;
    margin: 10px 0;
}

.dpi-slider::-webkit-slider-thumb, .quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dpi-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Aviso modo agressivo */
.aggressive-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    display: none;
    font-size: 0.9rem;
}

/* ============================================================
   BOTÕES PRINCIPAIS - CORRIGIDOS
============================================================ */
.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: #2980b9;
    text-decoration: none;
    color: white;
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* ============================================================
   MAIN AREA — PADRÃO FORENSYS
============================================================ */
.main-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #fafafa;
}

/* Estados da aplicação */
.state {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.state.active {
    display: block;
    opacity: 1;
}

/* Empty state */
.empty-state {
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}
#emptyState {
    display: flex;
    flex-direction: column;
    align-items: center;   /* Centraliza horizontalmente */
    text-align: center;    /* Garante que textos fiquem centralizados */
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    margin: 0 auto;
}

.empty-state h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.features-list {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.feature {
    padding: 8px 0;
    color: #495057;
    font-size: 0.95rem;
}

/* ============================================================
   CONTAINER DE PROGRESSO
============================================================ */
.loading-box {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #ececec;
    text-align: center;
}

#progressStage {
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4e73df, #224abe);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::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 shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================================
   SEÇÃO DE RESULTADO
============================================================ */
.preview-header {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.preview-icon {
    font-size: 2rem;
}

.stats-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card h5 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #495057;
    font-weight: 500;
}

.stat-value {
    color: #212529;
    font-weight: 600;
}

.savings {
    color: #28a745 !important;
}

.download-section {
    margin-top: 30px;
}

/* ============================================================
   SEÇÃO DE ERRO
============================================================ */
#errorSection {
    background: white;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

#errorMessage {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 6px;
}

/* ============================================================
   ANIMAÇÕES
============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   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;
    }

    .main-area {
        padding: 15px;
    }
    
    .preview-header {
        flex-direction: column;
        text-align: center;
    }
    
    .method-option {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .method-option input[type="radio"] {
        margin-bottom: 5px;
    }
}

/* ============================================================
   ESTILOS ESPECÍFICOS PARA CHECKBOXES E RADIOS
============================================================ */
input[type="checkbox"], input[type="radio"] {
    margin-right: 8px;
}

input[type="checkbox"] + span, input[type="radio"] + span {
    cursor: pointer;
}

/* ============================================================
   ESTILOS DE TEXTO E CORES
============================================================ */
.text-muted {
    color: #6c757d !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-center {
    text-align: center;
}

.d-block {
    display: block;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.me-2 { margin-right: 0.5rem; }

/* ============================================================
   BOX DE ERRO NO FORMULÁRIO
============================================================ */
.error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    display: none;
}

/* ============================================================
   TABELAS ESTILIZADAS (opcional, se quiser cards como no VideoTools)
============================================================ */
.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 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;
}
/* No compress.css, adicione: */
.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4e73df, #224abe, #4e73df);
    background-size: 200% 100%;
    transition: width 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    animation: progressAnimation 3s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Para quando estiver travado */
.progress-bar.stalled {
    background: linear-gradient(90deg, #ffc107, #fd7e14, #ffc107);
    animation: stalledAnimation 2s ease-in-out infinite;
}

@keyframes stalledAnimation {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Para quando estiver concluído */
.progress-bar.completed {
    background: #28a745;
    animation: none;
}