/* =====================================================
   TSV to PDF Tool Specific Styles
   (مكمل لملف tools.css الرئيسي)
   ===================================================== */

/* =====================================================
   1. Status Message
   ===================================================== */
.status-message {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.status-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.status-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.status-message.warning {
    background-color: #fed7aa;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* =====================================================
   2. Professional Processing Section
   ===================================================== */
.processing-section {
    display: none;
    align-items: flex-start;
    gap: 28px;
    padding: 28px;
    margin-top: 30px;
    border-radius: 24px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.03);
    animation: fadeInUp 0.35s ease;
    flex-wrap: wrap;
}


/* =====================================================
   منع الهزة في منطقة الرفع
   ===================================================== */
.upload-area {
    transition: none !important;
    transform: none !important;
    animation: none !important;
}

.upload-area:hover,
.upload-area:active,
.upload-area:focus {
    transform: none !important;
    transition: none !important;
}

/* تعطيل أي تأثير لـ drag-over */
.upload-area.drag-over {
    border-color: inherit !important;
    background-color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
    transition: none !important;
}

/* منع أي حركة داخلية */
.upload-inner,
.upload-icon,
.upload-text,
.upload-hint,
.upload-btn {
    transform: none !important;
    transition: none !important;
}
/* =====================================================
   3. Left File Card
   ===================================================== */
.file-info {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-radius: 20px;
    padding: 28px 20px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: all 0.3s ease;
}

.file-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: var(--primary, #00008B);
}

.file-info i {
    font-size: 54px;
    color: #10b981;
    margin-bottom: 18px;
}

.file-name-display {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
    word-break: break-word;
    line-height: 1.5;
}

.file-stats {
    font-size: 13px;
    color: #64748b;
    line-height: 1.7;
}

/* =====================================================
   4. Right Content Area
   ===================================================== */
.processing-content {
    flex: 1;
    min-width: 320px;
}

/* =====================================================
   5. Preview Textarea
   ===================================================== */
.preview-textarea {
    width: 50%;
    min-height: 500px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid #dbe4ee;
    background: #f8fafc;
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #0f172a;
    resize: vertical;
    transition: all 0.3s ease;
}

.preview-textarea:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.preview-textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary, #00008B);
    box-shadow: 0 0 0 4px rgba(0, 0, 139, 0.08);
}

.preview-textarea[readonly] {
    background: #f8fafc;
    cursor: default;
}

/* =====================================================
   6. Action Buttons
   ===================================================== */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-buttons .btn {
    height: 54px;
    padding: 0 32px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.action-buttons .btn-primary {
    background: linear-gradient(135deg, #00008B, #1d4ed8);
    color: #fff;
    border: none;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.18);
}

.action-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(29, 78, 216, 0.24);
}

.action-buttons .btn-primary:active {
    transform: translateY(0);
}

.action-buttons .btn-secondary {
    background: #f1f5f9;
    border: 1px solid #dbe4ee;
    color: #334155;
}

.action-buttons .btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.action-buttons .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.18);
}

.action-buttons .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.24);
}

/* =====================================================
   7. Progress Container
   ===================================================== */
.progress-container {
    margin: 24px 0;
    display: none;
}

.progress-bar-container {
    height: 8px;
    background: var(--border, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #00008B), #4338ca);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 12px;
    color: var(--text-light, #6b7280);
    text-align: center;
    margin-top: 8px;
}

/* =====================================================
   8. Success & Error Messages
   ===================================================== */
.success-message {
    margin-top: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #6ee7b7;
    color: #065f46;
    border-radius: 16px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    animation: fadeInUp 0.3s ease;
}

.success-message i {
    font-size: 20px;
    color: #10b981;
}

.error-message {
    margin-top: 20px;
    padding: 14px 20px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 16px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease;
    border: 1px solid #fecaca;
}

.error-message i {
    font-size: 18px;
    color: #ef4444;
}

/* =====================================================
   9. Loading Indicator
   ===================================================== */
.loading-indicator {
    display: none;
    margin: 30px 0;
    text-align: center;
    color: var(--primary, #00008B);
}

.loading-spinner {
    animation: spin 1s linear infinite;
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-light, #6b7280);
}

/* =====================================================
   10. PDF Preview Section
   ===================================================== */
.pdf-preview-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-light, #f9fafb);
    border-radius: 20px;
    border: 1px solid var(--border, #e5e7eb);
    animation: fadeInUp 0.4s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-wrap: wrap;
    gap: 15px;
}

.preview-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #111827);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.preview-title i {
    color: var(--primary, #00008B);
    font-size: 20px;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.btn-preview {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* PDF Viewer Container */
.pdf-viewer-container {
    width: 100%;
    height: 600px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
    background: white;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF Fallback */
.pdf-fallback {
    text-align: center;
    padding: 40px;
    background: #fef3c7;
    border-radius: 16px;
    border: 1px solid #fbbf24;
}

.pdf-fallback p {
    margin: 0;
    font-size: 14px;
    color: #92400e;
}

.fallback-link {
    color: var(--primary, #00008B);
    text-decoration: underline;
    margin-left: 5px;
    cursor: pointer;
}

.fallback-link:hover {
    color: #1e40af;
}

/* =====================================================
   11. Animations
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   12. Responsive Design
   ===================================================== */
@media (max-width: 992px) {
    .processing-section {
        padding: 20px;
        gap: 20px;
    }
    
    .file-info {
        width: 100%;
        min-width: 100%;
    }
    
    .processing-content {
        width: 100%;
        min-width: 100%;
    }
    
    .preview-textarea {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .processing-section {
        padding: 16px;
        gap: 16px;
    }
    
    .file-info {
        padding: 20px 16px;
    }
    
    .file-info i {
        font-size: 40px;
    }
    
    .file-name-display {
        font-size: 14px;
    }
    
    .preview-textarea {
        min-height: 300px;
        padding: 14px;
        font-size: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-buttons .btn {
        width: 100%;
        padding: 0 20px;
    }
    
    .success-message,
    .error-message {
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .status-message {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .pdf-preview-section {
        padding: 15px;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .preview-actions {
        width: 100%;
    }
    
    .btn-preview {
        width: 100%;
        justify-content: center;
    }
    
    .pdf-viewer-container {
        height: 400px;
    }
}

/* =====================================================
   13. Dark Mode Support
   ===================================================== */
@media (prefers-color-scheme: dark) {
    .processing-section {
        background: linear-gradient(145deg, #1e293b, #0f172a);
        border-color: #334155;
    }
    
    .file-info {
        background: #1e293b;
        border-color: #334155;
    }
    
    .file-info:hover {
        border-color: #3b82f6;
    }
    
    .file-name-display {
        color: #f1f5f9;
    }
    
    .file-stats {
        color: #94a3b8;
    }
    
    .preview-textarea {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .preview-textarea:hover {
        background: #1e293b;
    }
    
    .preview-textarea:focus {
        background: #1e293b;
        border-color: #3b82f6;
    }
    
    .status-message.success {
        background-color: rgba(16, 185, 129, 0.15);
    }
    
    .status-message.error {
        background-color: rgba(239, 68, 68, 0.15);
    }
    
    .success-message {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
        border-color: #10b981;
        color: #6ee7b7;
    }
    
    .error-message {
        background: rgba(239, 68, 68, 0.15);
        border-color: #ef4444;
        color: #fecaca;
    }
}

/* =====================================================
   14. Print Styles
   ===================================================== */
@media print {
    .upload-area,
    .action-buttons,
    .progress-container,
    .status-message,
    .download-section,
    .loading-indicator,
    .pdf-preview-section {
        display: none !important;
    }
    
    .processing-section {
        display: block !important;
        background: none;
        box-shadow: none;
        padding: 0;
    }
    
    .preview-textarea {
        border: none;
        padding: 0;
        min-height: auto;
    }
    
    .file-info {
        background: none;
        border: none;
        box-shadow: none;
    }
}