/* ==========================================================
   XML to PDF Converter - Additional Styles
   Professional & Consistent with DonePDF Design Language
   ========================================================== */

/* =====================================================
   1. TOOL CONTAINER
   ===================================================== */
.tool-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.tool-container {
    max-width: 900px;
    margin: 2rem auto 3rem;
    padding: 2.5rem 3rem;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
}

/* =====================================================
   2. INPUT SECTION
   ===================================================== */
.input-section {
    margin-bottom: 1.5rem;
}

.input-section .input-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 0.5rem;
}

.input-section .input-label i {
    color: #2563eb;
    margin-right: 0.5rem;
}

.input-section .input-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* =====================================================
   3. TEXTAREA (XML Input)
   ===================================================== */
.xml-textarea {
    width: 100%;
    min-height: 350px;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: #fafbfc;
    color: #0f172a;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.xml-textarea:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.xml-textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.xml-textarea::placeholder {
    color: #94a3b8;
}

/* =====================================================
   4. CONTENT AREA
   ===================================================== */
.content-area {
    margin-top: 1.5rem;
}

/* =====================================================
   5. OPTIONS SECTION
   ===================================================== */
.options-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.options-section .option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.options-section .option-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.options-section .option-group select,
.options-section .option-group input[type="text"],
.options-section .option-group input[type="number"] {
    padding: 0.6rem 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
    color: #0f172a;
}

.options-section .option-group select:focus,
.options-section .option-group input[type="text"]:focus,
.options-section .option-group input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.options-section .option-group select:hover,
.options-section .option-group input:hover {
    border-color: #cbd5e1;
}

/* Checkbox group */
.options-section .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.options-section .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
}

.options-section .checkbox-group label {
    text-transform: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
}

/* =====================================================
   6. BUTTONS
   ===================================================== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    min-width: 140px;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    background: linear-gradient(135deg, #334155, #1e293b);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-outline {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-outline:hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* =====================================================
   7. STATUS MESSAGES
   ===================================================== */
.status-message {
    padding: 1rem 1.5rem;
    border-radius: 14px;
    margin: 1.5rem 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

.status-message.show {
    display: flex;
}

.status-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-message.success i {
    color: #10b981;
}

.status-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-message.error i {
    color: #ef4444;
}

.status-message.loading {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.status-message.loading i {
    color: #2563eb;
    animation: spin 1s linear infinite;
}

.status-message.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-message.warning i {
    color: #f59e0b;
}

/* =====================================================
   8. SPINNER (Loading Indicator)
   ===================================================== */
.spinner-container {
    display: none;
    text-align: center;
    padding: 2rem 0;
}

.spinner-container.show {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.spinner-text {
    font-size: 0.9rem;
    color: #64748b;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   9. PREVIEW SECTION
   ===================================================== */
.preview-section {
    margin-top: 2rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    display: none;
    animation: slideUp 0.4s ease;
}

.preview-section.show {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-title i {
    color: #10b981;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.preview-actions .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    min-width: auto;
}

/* Preview content */
.preview-content {
    max-height: 500px;
    overflow: auto;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.preview-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #0f172a;
}

/* =====================================================
   10. PROGRESS BAR
   ===================================================== */
.progress-container {
    margin: 1.5rem 0;
    display: none;
}

.progress-container.show {
    display: block;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: center;
}

/* =====================================================
   11. RESULT SECTION
   ===================================================== */
.result-section {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: none;
}

.result-section.show {
    display: block;
    animation: slideUp 0.4s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.result-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header h3 i {
    color: #10b981;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.result-actions .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    min-width: 100px;
}

/* =====================================================
   12. RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 992px) {
    .tool-container {
        padding: 2rem;
        margin: 1.5rem 1.5rem 2.5rem;
    }
    
    .options-section {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1.5rem;
        margin: 1rem 1rem 2rem;
        border-radius: 16px;
    }
    
    .xml-textarea {
        min-height: 250px;
        padding: 0.8rem 1rem;
        font-size: 12px;
    }
    
    .options-section {
        grid-template-columns: 1fr;
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-group .btn {
        flex: 1 1 auto;
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        min-width: auto;
    }
    
    .preview-section {
        padding: 1rem 1.25rem;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .preview-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .result-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .status-message {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 1rem;
        margin: 0.75rem 0.5rem 1.5rem;
        border-radius: 12px;
    }
    
    .xml-textarea {
        min-height: 200px;
        padding: 0.6rem 0.8rem;
        font-size: 11px;
        border-radius: 10px;
    }
    
    .btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .options-section {
        padding: 0.75rem 1rem;
        border-radius: 10px;
    }
    
    .options-section .option-group label {
        font-size: 0.7rem;
    }
    
    .options-section .option-group select,
    .options-section .option-group input {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .preview-section {
        padding: 0.75rem 1rem;
    }
    
    .preview-content {
        max-height: 300px;
        padding: 0.75rem;
    }
    
    .preview-content pre {
        font-size: 11px;
    }
    
    .result-section {
        padding: 0.75rem 1rem;
    }
}

/* =====================================================
   13. DARK MODE SUPPORT
   ===================================================== */
@media (prefers-color-scheme: dark) {
    .tool-container {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    }
    
    .xml-textarea {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .xml-textarea:hover {
        background: #1e293b;
        border-color: #475569;
    }
    
    .xml-textarea:focus {
        border-color: #3b82f6;
        background: #1e293b;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    }
    
    .xml-textarea::placeholder {
        color: #64748b;
    }
    
    .options-section {
        background: #0f172a;
        border-color: #334155;
    }
    
    .options-section .option-group label {
        color: #94a3b8;
    }
    
    .options-section .option-group select,
    .options-section .option-group input {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .options-section .option-group select:focus,
    .options-section .option-group input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    }
    
    .options-section .checkbox-group label {
        color: #cbd5e1;
    }
    
    .btn-secondary {
        background: #1e293b;
        color: #94a3b8;
        border-color: #334155;
    }
    
    .btn-secondary:hover {
        background: #334155;
        color: #e2e8f0;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #334155, #1e293b);
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #475569, #334155);
    }
    
    .status-message.success {
        background: rgba(16, 185, 129, 0.15);
        color: #6ee7b7;
        border-color: #10b981;
    }
    
    .status-message.error {
        background: rgba(239, 68, 68, 0.15);
        color: #fecaca;
        border-color: #ef4444;
    }
    
    .status-message.loading {
        background: rgba(59, 130, 246, 0.15);
        color: #93c5fd;
        border-color: #3b82f6;
    }
    
    .status-message.warning {
        background: rgba(245, 158, 11, 0.15);
        color: #fcd34d;
        border-color: #f59e0b;
    }
    
    .preview-section {
        background: #0f172a;
        border-color: #334155;
    }
    
    .preview-header {
        border-color: #334155;
    }
    
    .preview-title {
        color: #f1f5f9;
    }
    
    .preview-content {
        background: #1e293b;
        border-color: #334155;
    }
    
    .preview-content pre {
        color: #e2e8f0;
    }
    
    .result-section {
        background: #0f172a;
        border-color: #334155;
    }
    
    .result-header {
        border-color: #334155;
    }
    
    .result-header h3 {
        color: #f1f5f9;
    }
}

/* =====================================================
   14. ANIMATIONS
   ===================================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}