/* Chatwoot Dashboard App - Al Raya Payment Link Styles */

:root {
    --primary-color: #0d47a1;
    --primary-hover: #082d6c;
    --primary-light: #e8f0fe;
    --secondary-color: #1e88e5;
    --success-color: #198754;
    --warning-color: #d97706;
    --danger-color: #dc3545;
    --bg-surface: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 13px;
    margin: 0;
    padding: 10px;
    overflow-x: hidden;
}

/* App Header */
.app-header {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.brand-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Context Panel */
.context-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.context-item {
    display: flex;
    flex-direction: column;
}

.context-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.context-value {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.context-value.highlight {
    color: var(--primary-color);
}

/* Main Form Card */
.form-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-size: 12.5px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.amount-input-group .input-group-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-color: #cbd5e1;
}

.btn-primary-action {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-primary-action:hover, .btn-primary-action:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13, 71, 161, 0.25);
}

/* Result / Created Box */
.payment-created-card {
    background: #ffffff;
    border: 1.5px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.created-amount {
    font-size: 22px;
    font-weight: 800;
    color: #065f46;
    margin-bottom: 4px;
}

.created-meta {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 10px;
}

.url-box {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 8px;
    font-family: monospace;
    font-size: 11px;
    word-break: break-all;
    user-select: all;
    margin-bottom: 12px;
    text-align: left;
    max-height: 55px;
    overflow-y: auto;
}

/* History Section */
.history-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #475569;
    margin: 0;
}

.payment-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 9px 0;
    transition: background-color 0.15s;
}

.payment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.payment-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}

.payment-item-amount {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.payment-item-gateway {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    display: inline-block;
}

.status-paid {
    background-color: #dcfce7;
    color: #15803d;
}

.status-pending {
    background-color: #fef3c7;
    color: #b45309;
}

.status-failed {
    background-color: #fee2e2;
    color: #b91c1c;
}

.status-cancelled {
    background-color: #f1f5f9;
    color: #475569;
}

.status-expired {
    background-color: #f1f5f9;
    color: #64748b;
}

.payment-item-meta {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}

.payment-actions {
    display: flex;
    gap: 6px;
}

.btn-mini {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Toast Notification */
.toast-notice {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Loading Spinner */
.spinner-inline {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

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

/* Chatwoot Protection Screens */
.restricted-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.restricted-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 22px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.restricted-icon-box {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fee2e2;
}

.restricted-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.restricted-badge {
    display: inline-block;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.restricted-desc {
    color: #475569;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.restricted-desc-ar {
    direction: rtl;
    color: #334155;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.chatwoot-pulse-loader {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

