/* moyasar-custom.css - Custom Styling for Moyasar Blazor Checkout */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #0b7956;
    --primary-hover: #086144;
    --primary-light: #e6f6f0;
    --primary-border: #80c8ab;
    --accent-color: #1a73e8;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --surface-bg: #f8fafc;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --warning-amber: #f59e0b;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

body {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    color: var(--text-dark);
}

/* Container */
.checkout-wrapper {
    max-width: 1180px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Checkout Header */
.checkout-header {
    margin-bottom: 2rem;
    text-align: center;
}

.checkout-header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.checkout-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.checkout-steps {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.checkout-steps .step {
    color: var(--text-muted);
}

.checkout-steps .step.active {
    color: var(--primary-color);
}

.checkout-steps .step-divider {
    color: #cbd5e1;
}

/* Method Selector Cards */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-method-card {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.payment-method-card:hover {
    border-color: var(--primary-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.payment-method-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(180deg, #f0fdf7 0%, #ffffff 100%);
    box-shadow: 0 0 0 1px var(--primary-color), var(--shadow-md);
}

.method-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.method-radio-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.payment-method-card.selected .method-radio-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.method-radio-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.payment-method-card.selected .method-radio-indicator .dot {
    opacity: 1;
    transform: scale(1);
}

.method-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.method-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.method-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.method-badge-img {
    height: 20px;
    object-fit: contain;
}

/* Card Container */
.checkout-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

/* Moyasar Dynamic Form Container */
.moyasar-form-container {
    min-height: 240px;
    position: relative;
    padding: 0.5rem 0;
}

/* Loading Spinner */
.form-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Order Summary Box */
.order-summary-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 1.5rem;
}

.summary-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-badge-id {
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: #475569;
}

.summary-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.9rem;
}

.summary-item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.summary-calc-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 2px solid #e2e8f0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Security Trust Badges */
.trust-seals-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.trust-seals-box .trust-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.trust-badges-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trust-pill {
    background: white;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Moyasar Form Overrides & Enhancements */
.mysr-form {
    max-width: 100% !important;
}

.mysr-form input[type="text"],
.mysr-form input[type="tel"],
.mysr-form input[type="password"] {
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    font-family: inherit !important;
    padding: 0.65rem 0.85rem !important;
    transition: border-color 0.2s ease !important;
}

.mysr-form input:focus {
    border-color: var(--primary-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(11, 121, 86, 0.15) !important;
}

.mysr-form button.mysr-btn,
.mysr-form .mysr-btn {
    background-color: var(--primary-color) !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
}

.mysr-form button.mysr-btn:hover {
    background-color: var(--primary-hover) !important;
}

/* Receipt / Invoice Styles */
.receipt-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    max-width: 650px;
    margin: 2rem auto;
    border: 1px solid var(--border-color);
}

.receipt-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-icon-wrapper.success {
    background: #ecfdf5;
    color: var(--success-green);
    border: 2px solid #a7f3d0;
}

.receipt-icon-wrapper.failed {
    background: #fef2f2;
    color: var(--danger-red);
    border: 2px solid #fecaca;
}

.receipt-header {
    text-align: center;
    margin-bottom: 2rem;
}

.receipt-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.receipt-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.receipt-data-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.receipt-data-table td {
    padding: 0.75rem 0.5rem;
}

.receipt-data-table td.label {
    color: var(--text-muted);
    font-weight: 600;
    width: 40%;
}

.receipt-data-table td.value {
    font-weight: 700;
    text-align: left;
    direction: ltr;
}

.receipt-data-table td.value.ar {
    text-align: left;
    direction: rtl;
}

/* Sandbox banner */
.sandbox-alert-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    color: #92400e;
}

.sandbox-test-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.test-card-btn {
    background: #ffffff;
    border: 1px solid #fcd34d;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.test-card-btn:hover {
    background: #fef3c7;
}

@media print {
    body {
        background: white !important;
    }
    .no-print {
        display: none !important;
    }
    .receipt-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
}
