/* ===========================
   WooCommerce Points System Styles
   =========================== */

/* RTL Support for Arabic */
body.rtl .wc-points-account,
body[dir="rtl"] .wc-points-account,
.wc-points-account {
    direction: rtl;
    text-align: right;
}

body.rtl .wc-points-redemption,
body[dir="rtl"] .wc-points-redemption,
.wc-points-redemption {
    direction: rtl;
    text-align: right;
}

/* Arabic Font Improvement */
.wc-points-account,
.wc-points-redemption {
    font-family: 'Tajawal', 'Cairo', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* My Account - Points Page */
.wc-points-account {
    max-width: 800px;
    margin: 0 auto;
}

.wc-points-balance-card {
    background: linear-gradient(135deg, var(--ast-global-color-1) 0%, var(--ast-global-color-2) 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.points-balance {
    text-align: center;
    margin-bottom: 30px;
}

.balance-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.balance-amount {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.balance-amount .points-text {
    font-size: 18px;
    font-weight: normal;
    opacity: 0.9;
}

.balance-value {
    font-size: 18px;
    opacity: 0.9;
}

.points-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.info-item {
    font-size: 14px;
}

.info-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .points-info {
        grid-template-columns: 1fr;
    }
    
    .balance-amount {
        font-size: 36px;
    }
}

/* Call to Action */
.wc-points-cta {
    text-align: center;
    margin-bottom: 30px;
}

.wc-points-cta .button {
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 5px;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-points-cta .button:hover {
    background: var(--ast-global-color-2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Info Message */
.wc-points-info-message {
    background: #ecf6f8;
    border-left: 4px solid var(--ast-global-color-2);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.wc-points-info-message p {
    margin: 0;
    color: var(--ast-global-color-2);
    font-weight: 500;
}

/* Points History */
.wc-points-history {
    margin-top: 40px;
}

.wc-points-history h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.wc-points-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.wc-points-table thead {
    background: #f8f9fa;
}

.wc-points-table th {
    padding: 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 2px solid #e9ecef;
}

.wc-points-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.wc-points-table tbody tr:last-child td {
    border-bottom: none;
}

.wc-points-table tbody tr:hover {
    background: #f8f9fa;
}

.points-cell {
    font-weight: bold;
    font-size: 16px;
}

.points-cell.earned {
    color: #28a745;
}

.points-cell.redeemed {
    color: #dc3545;
}

.transaction-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-badge.transaction-earned {
    background: #d4edda;
    color: #155724;
}

.transaction-badge.transaction-redeemed {
    background: #f8d7da;
    color: #721c24;
}

.transaction-badge.transaction-restored {
    background: #d1ecf1;
    color: #0c5460;
}

.transaction-badge.transaction-review {
    background: #e2d9f3;
    color: #432874;
}

.transaction-badge.transaction-expired {
    background: #e2e3e5;
    color: #383d41;
}

.expiry-cell {
    font-size: 13px;
    color: #555;
}

.expiry-used {
    color: #999;
    font-style: italic;
}

/* Warning info item */
.info-item--warning {
    background: rgba(255, 193, 7, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
}

.info-item--warning strong {
    color: red;
}

.info-item--warning p {
    color: rgba(255, 255, 255, 0.95) !important;
}

.transaction-badge br {
    display: none;
}

/* Empty State */
.wc-points-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Checkout - Points Redemption */
.wc-points-redemption {
    background: #f8f9fa;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.wc-points-redemption h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.wc-points-redemption-info {
    margin-bottom: 20px;
}

.wc-points-redemption-info p {
    margin: 0 0 5px 0;
    color: #555;
}

.wc-points-redemption-info .small-text {
    font-size: 13px;
    color: #777;
}

.wc-points-redemption-field {
    margin-bottom: 20px;
}

.wc-points-redemption-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.points-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.points-input-group input[type="number"] {
    flex: 1;
    min-width: 120px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.points-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.points-input-group button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

#apply-points-btn {
    background: var(--ast-global-color-1);
    color: #fff;
}

#apply-points-btn:hover:not(:disabled) {
    background: var(--ast-global-color-2);
    transform: translateY(-1px);
}

#apply-points-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#remove-points-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

#remove-points-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* Quick Select */
.wc-points-quick-select {
    margin-top: 15px;
}

.quick-select-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.quick-select-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-select-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.quick-select-btn:hover {
    background: var(--ast-global-color-1);
    color: #fff;
    border-color: var(--ast-global-color-1);
}

/* Messages */
.wc-points-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.wc-points-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-points-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-points-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-points-redemption {
        padding: 20px;
    }
    
    .points-input-group {
        flex-direction: column;
    }
    
    .points-input-group input[type="number"],
    .points-input-group button {
        width: 100%;
    }
    
    .wc-points-table {
        font-size: 14px;
    }
    
    .wc-points-table th,
    .wc-points-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .wc-points-table {
        font-size: 12px;
    }
    
    .wc-points-table th:first-child,
    .wc-points-table td:first-child {
        display: none;
    }
}

/* ===========================
   Section Titles
   =========================== */
.wc-points-account h3.section-title,
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: #333;
    margin: 40px 0 16px;
    border: none;
    padding: 0;
}

.section-title__icon {
    font-size: 20px;
    line-height: 1;
}

/* ===========================
   Pending Points
   =========================== */
.wc-points-pending {
    margin-bottom: 10px;
}

.pending-intro {
    font-size: 13px;
    color: #777;
    margin: 0 0 12px;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pending-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-right: 4px solid #f0ad4e;
    border-radius: 6px;
    padding: 14px 16px;
}

body.rtl .pending-item,
body[dir="rtl"] .pending-item {
    border-right: none;
    border-left: 4px solid #f0ad4e;
}

.pending-item__points {
    font-size: 22px;
    font-weight: 700;
    color: #f0ad4e;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

.pending-item__points span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-top: 2px;
}

.pending-item__details {
    flex: 1;
}

.pending-item__source {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 3px;
}

.pending-item__date {
    font-size: 13px;
    color: #777;
}

.pending-item__date strong {
    color: #555;
}

.balance-pending-hint {
    display: inline-block;
    margin-top: 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    opacity: 0.95;
}

/* ===========================
   Referral Card
   =========================== */
.wc-referral-section {
    margin-bottom: 10px;
}

.referral-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.referral-card__reward {
    display: flex;
    align-items: baseline;
    gap: 10px;
    background: linear-gradient(135deg, var(--ast-global-color-1) 0%, var(--ast-global-color-2) 100%);
    color: #fff;
    padding: 18px 22px;
}

.reward-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.reward-label {
    font-size: 15px;
    opacity: 0.92;
}

.referral-card__stats {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

.referral-stat {
    flex: 1;
    text-align: center;
    padding: 16px 12px;
    border-left: 1px solid #f0f0f0;
}

.referral-stat:last-child {
    border-left: none;
}

body.rtl .referral-stat,
body[dir="rtl"] .referral-stat {
    border-left: none;
    border-right: 1px solid #f0f0f0;
}

body.rtl .referral-stat:last-child,
body[dir="rtl"] .referral-stat:last-child {
    border-right: none;
}

.referral-stat__value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.referral-stat__label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.referral-card__link {
    padding: 18px 22px;
}

.referral-link-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.referral-link-row {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.referral-link-row input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    outline: none;
    font-size: 13px;
    color: #444;
    background: #fafafa;
    direction: ltr;
    min-width: 0;
}

#copy-referral-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--ast-global-color-1);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
    font-family: inherit;
}

#copy-referral-link:hover {
    background: var(--ast-global-color-2);
}

#copy-referral-link.copied {
    background: #28a745;
}

/* ===========================
   Empty State (Arabic)
   =========================== */
.wc-points-empty {
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #888;
}

.wc-points-empty__icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.wc-points-empty p {
    margin: 0;
    font-size: 15px;
}

/* ===========================
   Responsive additions
   =========================== */
@media (max-width: 480px) {
    .referral-card__reward {
        flex-direction: column;
        gap: 4px;
    }

    .referral-stat__value {
        font-size: 22px;
    }

    .pending-item__points {
        font-size: 18px;
        min-width: 55px;
    }
}