/* =====================================================
   Spreadsheet to PDF - CSS (مستوحى من تصميم DonePDF)
   متوافق مع هيكل spreadsheet-to-pdf
   ===================================================== */

/* ===== Main Container ===== */
.tool-wrapper[data-tool="spreadsheet-to-pdf"] {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: #1e293b;
}

/* ===== Instructions ===== */
.instructions {
    background: #f0f7ff;
    border-left: 4px solid #0067b8;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.instructions h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}
.instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}
.instructions ol li {
    margin-bottom: 0.15rem;
}

/* ===== Editor Layout ===== */
.editor-layout {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9edf2;
}

/* ===== Input Group ===== */
.input-group {
    margin-bottom: 1.25rem;
}
.input-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.4rem;
}
.input-field {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d9e6;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.input-field:focus {
    border-color: #0067b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 103, 184, 0.12);
}
.input-field::placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    margin: 0 0 1rem 0;
}
.btn {
    padding: 0.6rem 1.8rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-primary {
    background: #0067b8;
    color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
    background: #005499;
    box-shadow: 0 4px 12px rgba(0, 103, 184, 0.25);
}
.btn-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #d1d9e6;
}
.btn-secondary:hover { background: #e2e8f0; }

/* ===== Status & Messages ===== */
.status-message {
    background: #f8fafc;
    border: 1px solid #e9edf2;
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #1e293b;
    display: none;
}
.status-message.show { display: block; }
.status-message.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.status-message.error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.error-message {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin: 0.5rem 0 1rem 0;
    color: #991b1b;
    font-weight: 500;
    font-size: 0.9rem;
    display: none;
}
.error-message.show { display: block; }

.success-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #065f46;
    font-weight: 500;
    font-size: 0.9rem;
}
.success-message i {
    color: #0b7e3d;
    font-size: 1.25rem;
}

/* ===== Progress Bar ===== */
.progress-container {
    background: #e9edf2;
    border-radius: 2rem;
    height: 28px;
    margin: 0.5rem 0 0.75rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0067b8, #3b8fd9);
    border-radius: 2rem;
    transition: width 0.4s ease;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.3px;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0;
    color: #475569;
    font-weight: 500;
}
.loading-spinner {
    font-size: 1.6rem;
    color: #0067b8;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .tool-wrapper[data-tool="spreadsheet-to-pdf"] {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    .editor-layout {
        padding: 1rem;
    }
    .instructions {
        padding: 1rem;
    }
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .action-buttons .btn {
        justify-content: center;
        width: 100%;
    }
    .input-field {
        font-size: 0.9rem;
        padding: 0.55rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .editor-layout {
        padding: 0.75rem;
    }
    .instructions ol {
        font-size: 0.8rem;
        padding-left: 1rem;
    }
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 1.2rem;
    }
    .progress-container {
        height: 24px;
    }
    .progress-text {
        font-size: 0.7rem;
    }
}

/* ===== RTL Support ===== */
html[dir="rtl"] .btn i,
html[dir="rtl"] .success-message i {
    margin-left: 0.4rem;
    margin-right: 0;
}
html[dir="rtl"] .instructions {
    border-left: none;
    border-right: 4px solid #0067b8;
}
html[dir="rtl"] .instructions ol {
    padding-left: 0;
    padding-right: 1.25rem;
}
html[dir="rtl"] .action-buttons {
    justify-content: flex-end;
}
html[dir="rtl"] .loading-spinner {
    margin-left: 0.4rem;
}
html[dir="rtl"] .progress-text {
    left: auto;
    right: 0;
}