/* ============================================================
   FORENSYS PDF SPLITTER - MESMO ESTILO DOS APPS ANTERIORES
============================================================ */

/* ---------- LAYOUT BASE ---------- */
.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 ---------- */
.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #0D6EFD 100%);
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.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;
}

.file-info {
    margin-top: 10px;
    padding: 12px;
    background: #e9ecef;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* ---------- OPÇÕES DE DIVISÃO ---------- */
.split-options {
    margin-top: 20px;
}

.split-options h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.method-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.method-option {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.method-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.method-option input[type="radio"] {
    margin-top: 3px;
    margin-right: 10px;
}

.method-label {
    flex: 1;
}

.method-label strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 3px;
}

.method-label small {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.option-group {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ---------- BOTÕES ---------- */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* ---------- MAIN AREA ---------- */
.main-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.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.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.empty-state p {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.features-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.feature {
    padding: 10px 15px;
    color: #495057;
    font-size: 0.95rem;
    border-left: 3px solid #667eea;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0 6px 6px 0;
}

/* ---------- PROGRESSO ---------- */
.loading-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.loading-box h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#progressStage {
    font-weight: 500;
    color: #495057;
    margin-bottom: 15px;
    min-height: 24px;
}

.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    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; }
}

#progressPercent {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

/* ---------- RESULTADO ---------- */
.preview-header {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.preview-icon {
    font-size: 2rem;
}

.preview-header h4 {
    color: #155724;
    margin: 0;
}

#successMessage {
    color: #0c5460;
}

.stats-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stats-card h5 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.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;
}

.download-section {
    margin-top: 30px;
}

/* ---------- ERRO ---------- */
#errorSection .loading-box {
    background: #fff5f5;
    border-color: #f5c6cb;
}

#errorMessage {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* ---------- 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;
    }
}

/* ---------- 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);
    }
}

/* ---------- UTILIDADES ---------- */
.text-muted {
    color: #6c757d !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.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-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

.error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    display: none;
    font-size: 0.9rem;
}