/**
 * Tasawwq Order Abroad - Frontend Stylesheet
 * Brand Identity: Tasawwq Red (#E60000) & Dark Red (#B30000)
 * Direction: RTL
 */

:root {
    --oab-primary: #E60000;
    --oab-primary-hover: #CC0000;
    --oab-primary-dark: #B30000;
    --oab-primary-deeper: #8A0000;
    --oab-primary-light: #FFF5F5;
    --oab-primary-tint: #FFEAEA;
    --oab-accent: #B30000;

    /* Theme alias variables for seamless integration */
    --oab-gold: #E60000;
    --oab-gold-dark: #B30000;
    --oab-gold-light: #FFF5F5;
    --oab-teal: #E60000;
    --oab-teal-dark: #B30000;
    --oab-teal-light: #FFF5F5;

    --oab-text: #1e293b;
    --oab-text-muted: #64748b;
    --oab-bg: #f8fafc;
    --oab-card-bg: #ffffff;
    --oab-border: #e2e8f0;
    --oab-border-focus: #E60000;
    --oab-radius-sm: 8px;
    --oab-radius: 14px;
    --oab-radius-lg: 20px;
    --oab-shadow: 0 4px 24px rgba(230, 0, 0, 0.08);
    --oab-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --oab-font: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --oab-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Container */
.oab-wizard-wrapper {
    font-family: var(--oab-font);
    direction: rtl;
    text-align: right;
    max-width: 820px;
    margin: 30px auto;
    background: var(--oab-card-bg);
    border-radius: var(--oab-radius-lg);
    box-shadow: var(--oab-shadow);
    border: 1px solid var(--oab-border);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.oab-wizard-wrapper *,
.oab-wizard-wrapper *::before,
.oab-wizard-wrapper *::after {
    box-sizing: border-box;
}

/* Hero Header */
.oab-hero-header {
    background: linear-gradient(135deg, var(--oab-primary) 0%, var(--oab-primary-dark) 100%);
    padding: 36px 30px 28px;
    color: #ffffff;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--oab-primary-dark);
}

.oab-hero-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.oab-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.oab-hero-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #ffffff !important;
    line-height: 1.3;
}

.oab-hero-subtitle {
    font-size: 15px;
    color: #ffeaea;
    margin: 0 auto 20px;
    max-width: 620px;
    line-height: 1.6;
}

.oab-trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 15px;
}

.oab-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12.5px;
    color: #ffffff;
}

/* Steps Indicator */
.oab-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: #f8fafc;
    border-bottom: 1px solid var(--oab-border);
}

.oab-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    cursor: default;
    flex: 0 0 auto;
}

.oab-step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: var(--oab-transition);
}

.oab-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: var(--oab-transition);
    white-space: nowrap;
}

.oab-step-node.active .oab-step-circle {
    background: var(--oab-primary);
    border-color: var(--oab-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(230, 0, 0, 0.15);
}

.oab-step-node.active .oab-step-label {
    color: var(--oab-primary);
    font-weight: 700;
}

.oab-step-node.completed .oab-step-circle {
    background: var(--oab-primary-dark);
    border-color: var(--oab-primary-dark);
    color: #ffffff;
}

.oab-step-node.completed .oab-step-circle::before {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
}

.oab-step-node.completed .oab-step-label {
    color: var(--oab-text);
}

.oab-step-line {
    flex: 1 1 auto;
    height: 3px;
    background: #cbd5e1;
    margin: 0 10px 22px;
    position: relative;
    transition: var(--oab-transition);
}

.oab-step-line.completed {
    background: var(--oab-primary);
}

/* Form Panes */
.oab-form {
    padding: 30px;
}

.oab-step-pane {
    display: none;
    animation: oabFadeIn 0.3s ease-in-out;
}

.oab-step-pane.active {
    display: block;
}

@keyframes oabFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oab-pane-header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--oab-border);
}

.oab-pane-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--oab-primary-dark);
    margin: 0 0 6px;
}

.oab-pane-desc {
    font-size: 14px;
    color: var(--oab-text-muted);
    margin: 0;
}

/* Form Groups & Controls */
.oab-form-group {
    margin-bottom: 20px;
}

.oab-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--oab-text);
    margin-bottom: 8px;
}

.oab-required {
    color: #ef4444;
}

.oab-input,
.oab-select,
.oab-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--oab-border);
    border-radius: var(--oab-radius-sm);
    font-family: var(--oab-font);
    font-size: 14px;
    color: var(--oab-text);
    background: #ffffff;
    transition: var(--oab-transition);
    outline: none;
}

.oab-input:focus,
.oab-select:focus,
.oab-textarea:focus {
    border-color: var(--oab-border-focus);
    box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.18);
}

.oab-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.oab-input-icon {
    position: absolute;
    right: 12px;
    font-size: 16px;
    pointer-events: none;
    color: var(--oab-text-muted);
}

.oab-input-with-icon .oab-input {
    padding-right: 40px;
}

.oab-help-text {
    display: block;
    font-size: 12px;
    color: var(--oab-text-muted);
    margin-top: 5px;
}

/* Sources Grid */
.oab-sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.oab-source-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border: 2px solid var(--oab-border);
    border-radius: var(--oab-radius-sm);
    background: #ffffff;
    cursor: pointer;
    text-align: center;
    transition: var(--oab-transition);
    user-select: none;
    position: relative;
}

.oab-source-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.oab-source-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--oab-text);
    margin-bottom: 2px;
}

.oab-source-sub {
    font-size: 11px;
    color: var(--oab-text-muted);
}

.oab-source-card:hover {
    border-color: var(--oab-primary-tint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 0, 0.06);
}

.oab-source-card.selected {
    border-color: var(--oab-primary);
    background: var(--oab-primary-light);
    box-shadow: 0 0 0 2px var(--oab-primary);
}

.oab-source-card.selected .oab-source-name {
    color: var(--oab-primary);
}

/* Product Card Box */
.oab-product-card {
    background: #ffffff;
    border: 1.5px solid var(--oab-border);
    border-radius: var(--oab-radius);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.oab-prod-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.oab-prod-number {
    font-size: 14px;
    font-weight: 800;
    color: var(--oab-primary);
    background: var(--oab-primary-light);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--oab-primary-tint);
}

.oab-remove-prod-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--oab-transition);
}

.oab-remove-prod-btn:hover {
    background: #fef2f2;
}

/* Dropzone Upload */
.oab-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--oab-radius-sm);
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
    transition: var(--oab-transition);
}

.oab-dropzone:hover,
.oab-dropzone.dragover {
    border-color: var(--oab-primary);
    background: var(--oab-primary-light);
}

.oab-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.oab-drop-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.oab-drop-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--oab-text);
}

.oab-drop-hint {
    font-size: 12px;
    color: var(--oab-text-muted);
    margin-top: 4px;
}

.oab-previews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    justify-content: center;
}

.oab-preview-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--oab-border);
    position: relative;
}

/* Grids */
.oab-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.oab-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Radio & Checkbox Pills */
.oab-radio-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.oab-radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--oab-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    background: #ffffff;
    transition: var(--oab-transition);
}

.oab-radio-pill:hover {
    border-color: var(--oab-primary);
}

.oab-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--oab-text);
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
}

.oab-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--oab-primary);
    width: 17px;
    height: 17px;
}

.oab-quick-phone-match {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--oab-text-muted);
}

.oab-terms-link {
    color: var(--oab-primary);
    text-decoration: underline;
    font-weight: 700;
}

/* Add Another Product Button */
.oab-add-product-wrapper {
    text-align: center;
    margin: 20px 0 25px;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed var(--oab-border);
    border-radius: var(--oab-radius-sm);
}

.oab-add-prod-hint {
    display: block;
    font-size: 12px;
    color: var(--oab-text-muted);
    margin-top: 6px;
}

/* Review Cards */
.oab-review-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.oab-review-card {
    border: 1.5px solid var(--oab-border);
    border-radius: var(--oab-radius);
    padding: 18px;
    background: #fafbfc;
}

.oab-review-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--oab-primary-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
}

.oab-review-edit-btn {
    background: none;
    border: none;
    color: var(--oab-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

.oab-review-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    padding: 5px 0;
    color: var(--oab-text);
}

.oab-review-item-row span:first-child {
    color: var(--oab-text-muted);
}

/* Buttons */
.oab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--oab-radius-sm);
    font-family: var(--oab-font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--oab-transition);
    border: none;
    text-decoration: none;
    line-height: 1;
}

.oab-btn-primary {
    background: var(--oab-primary);
    color: #ffffff !important;
}

.oab-btn-primary:hover {
    background: var(--oab-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 0, 0.25);
}

.oab-btn-secondary {
    background: #f1f5f9;
    color: #475569 !important;
}

.oab-btn-secondary:hover {
    background: #e2e8f0;
}

.oab-btn-outline {
    background: transparent;
    border: 2px solid var(--oab-primary);
    color: var(--oab-primary) !important;
}

.oab-btn-outline:hover {
    background: var(--oab-primary-light);
}

.oab-btn-success {
    background: linear-gradient(135deg, var(--oab-primary) 0%, var(--oab-primary-dark) 100%);
    color: #ffffff !important;
    font-weight: 800;
}

.oab-btn-success:hover {
    box-shadow: 0 6px 20px rgba(230, 0, 0, 0.4);
    transform: translateY(-2px);
}

.oab-btn-lg {
    padding: 16px 36px;
    font-size: 16.5px;
}

.oab-btn-whatsapp {
    background: #25D366;
    color: #ffffff !important;
}

.oab-btn-whatsapp:hover {
    background: #1ebc57;
}

.oab-pane-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

/* Spinner */
.oab-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: oabSpin 0.7s linear infinite;
}

@keyframes oabSpin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.oab-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.oab-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Success Screen */
.oab-success-screen {
    text-align: center;
    padding: 30px 20px 10px;
}

.oab-success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.oab-success-icon {
    font-size: 40px;
    color: #16a34a;
    font-weight: bold;
}

.oab-success-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--oab-primary-dark);
    margin: 0 0 10px;
}

.oab-success-subtitle {
    font-size: 15px;
    color: var(--oab-text-muted);
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.oab-order-badge-box {
    background: var(--oab-primary-light);
    border: 1.5px solid var(--oab-primary-tint);
    border-radius: var(--oab-radius);
    padding: 18px;
    max-width: 380px;
    margin: 0 auto 25px;
}

.oab-order-badge-lbl {
    font-size: 13px;
    color: var(--oab-primary-dark);
    font-weight: 600;
}

.oab-order-number {
    font-size: 24px;
    font-weight: 900;
    color: var(--oab-primary);
    letter-spacing: 1px;
    margin: 6px 0;
    font-family: monospace, var(--oab-font);
}

.oab-order-badge-note {
    font-size: 12px;
    color: var(--oab-text-muted);
}

.oab-success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    margin: 0 auto;
}

/* Modal Backdrop & Dialog */
.oab-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: oabBackdropFade 0.25s ease;
}

@keyframes oabBackdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.oab-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: var(--oab-radius-lg);
    background: #ffffff;
    box-shadow: var(--oab-shadow-lg);
    animation: oabModalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes oabModalScale {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.oab-modal-close {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--oab-transition);
}

.oab-modal-close:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: rotate(90deg);
}

.oab-is-modal {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .oab-wizard-wrapper {
        margin: 10px;
        border-radius: var(--oab-radius);
    }

    .oab-hero-header {
        padding: 24px 16px 20px;
    }

    .oab-hero-title {
        font-size: 22px;
    }

    .oab-steps-indicator {
        padding: 16px 12px;
    }

    .oab-step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .oab-step-label {
        font-size: 11px;
    }

    .oab-form {
        padding: 20px 16px;
    }

    .oab-grid-2,
    .oab-grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .oab-sources-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .oab-pane-actions {
        flex-direction: column-reverse;
    }

    .oab-pane-actions .oab-btn {
        width: 100%;
    }

    .oab-modal-backdrop {
        padding: 10px;
    }

    .oab-modal-dialog {
        max-height: 96vh;
    }
}

/* Standalone Dedicated Page Wrapper */
.oab-standalone-page-wrapper {
    min-height: 65vh;
    padding: 30px 0 60px;
    background-color: var(--oab-bg, #f8fafc);
}

.oab-standalone-page-wrapper .oab-wizard-wrapper {
    margin: 0 auto;
}

/* Extracted URL & Title Notification Hint */
.oab-url-extracted-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--oab-radius-sm, 8px);
    color: #166534;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    animation: oabBackdropFade 0.25s ease;
}

.oab-url-extracted-hint .oab-hint-icon {
    font-size: 14px;
    margin-left: 4px;
}

