/**
 * Converter para PDF - Estilos
 * Utilitys.Top
 */

/* ========== Reset e Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== Container Principal ========== */
.pdf-converter {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== Header ========== */
.converter-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #0077b6 0%, #00a8e8 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 119, 182, 0.3);
}

.converter-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.converter-header h1 i {
    font-size: 2.5rem;
}

.converter-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ========== Panel Principal ========== */
.converter-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ========== Seções ========== */
.upload-section,
.files-section,
.controls-section,
.result-section {
    padding: 25px;
    border-bottom: 1px solid #e6e6e6;
}

.result-section {
    border-bottom: none;
}

.upload-section h2,
.files-section h2,
.controls-section h2,
.result-section h2 {
    font-size: 1.3rem;
    color: #0077b6;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== Dropzone ========== */
.dropzone {
    border: 3px dashed #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: #0077b6;
    background: #f0f9ff;
}

.dropzone.dz-drag-hover {
    border-color: #00a8e8;
    background: #e3f2fd;
    border-style: solid;
}

.dropzone .dz-message {
    margin: 0;
}

.dropzone .dz-message i {
    font-size: 4rem;
    color: #0077b6;
    display: block;
    margin-bottom: 15px;
}

.dropzone .dz-message p {
    font-size: 1.1rem;
    color: #333;
    margin: 10px 0;
}

.dropzone .dz-message .dz-hint {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
}

.dropzone .dz-preview {
    margin: 10px;
    display: inline-block;
}

/* ========== Lista de Arquivos ========== */
.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-top: 5px;
}

.file-item:first-child {
    margin-top: 0;
}

.files-list::-webkit-scrollbar {
    width: 8px;
}

.files-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: #0077b6;
    border-radius: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: move;
}

.file-item:hover {
    background: #f0f9ff;
    border-color: #0077b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.1);
}

.file-icon {
    font-size: 2rem;
    color: #0077b6;
    min-width: 40px;
    text-align: center;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.85rem;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* ========== Controles ========== */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.mode-option {
    display: block;
    cursor: pointer;
    position: relative;
}

.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e6e6e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option input[type="radio"]:checked + .mode-label {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
    border-color: #0077b6;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.2);
}

.mode-label i {
    font-size: 2.5rem;
    color: #0077b6;
    margin-bottom: 10px;
}

.mode-label strong {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.mode-label small {
    font-size: 0.9rem;
    color: #666;
}

/* ========== Botões ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    background: #f3f4f6;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #0077b6 0%, #00a8e8 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a8d 0%, #0086ba 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #43c056 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34 0%, #2fa43a 100%);
}

.btn-warn {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.btn-warn:hover:not(:disabled) {
    background: #ffc107;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e6e6e6;
    color: #666;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #0077b6;
    color: #0077b6;
}

.btn-icon.btn-move-up:hover {
    color: #28a745;
    border-color: #28a745;
}

.btn-icon.btn-move-down:hover {
    color: #ffc107;
    border-color: #ffc107;
}

.btn-icon.btn-remove:hover {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== Área de Resultado ========== */
.preview-area {
    margin-top: 15px;
}

.result-merged {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: #0077b6;
}

.result-header i {
    font-size: 1.5rem;
}

.result-preview iframe {
    width: 100%;
    height: 500px;
    border: 2px solid #e6e6e6;
    border-radius: 8px;
}

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

.result-individual {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
}

.result-item i {
    font-size: 1.5rem;
    color: #dc3545;
}

.result-item .btn-success i,
.result-actions .btn-success i {
    color: white;
}

.result-item span {
    flex: 1;
    font-weight: 600;
}

.result-item-actions {
    display: flex;
    gap: 8px;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 4rem;
    color: #0077b6;
    display: block;
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

/* ========== Notificações ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification i {
    font-size: 1.5rem;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-success i {
    color: #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-error i {
    color: #dc3545;
}

.notification-info {
    border-left: 4px solid #0077b6;
}

.notification-info i {
    color: #0077b6;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-warning i {
    color: #ffc107;
}

/* ========== Responsivo ========== */
@media (max-width: 768px) {
    .pdf-converter {
        padding: 10px;
    }
    
    .converter-header h1 {
        font-size: 1.8rem;
    }
    
    .converter-header p {
        font-size: 1rem;
    }
    
    .upload-section,
    .files-section,
    .controls-section,
    .result-section {
        padding: 15px;
    }
    
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    .converter-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
    }
    
    .dropzone .dz-message i {
        font-size: 3rem;
    }
    
    .file-icon {
        font-size: 1.5rem;
        min-width: 30px;
    }
}
