/**
 * Boma Points WooCommerce - Frontend Styles
 *
 * @package Boma_Points_WooCommerce
 */

/* Dashboard Widget */
.boma-points-dashboard-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.boma-points-dashboard-widget h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.9;
}

.boma-points-dashboard-widget .boma-points-balance {
    font-size: 14px;
    margin: 0 0 15px;
}

.boma-points-dashboard-widget .boma-points-balance strong {
    font-size: 36px;
    display: block;
    margin-bottom: 5px;
}

.boma-points-dashboard-widget a {
    color: #fff;
    text-decoration: underline;
}

.boma-points-dashboard-widget a:hover {
    opacity: 0.8;
}

/* Points Account Page */
.boma-points-account h2 {
    margin-bottom: 20px;
}

.boma-points-account h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* Points Summary */
.boma-points-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.boma-points-balance-large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.boma-points-balance-large .balance {
    display: block;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
}

.boma-points-balance-large .label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Referral Section */
.boma-points-referral {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.boma-points-referral h3 {
    margin: 0 0 10px;
    padding: 0;
    border: none;
    font-size: 18px;
}

.boma-points-referral p {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
}

.boma-points-referral .referral-code {
    background: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    text-align: center;
    border: 2px dashed #667eea;
    margin-bottom: 15px;
}

.boma-points-referral .referral-code code {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    background: none;
}

/* Earn Points List */
.boma-points-earn-list {
    background: #f8f9fa;
    padding: 20px 20px 20px 40px;
    border-radius: 8px;
    margin: 0;
}

.boma-points-earn-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    color: #333;
}

.boma-points-earn-list li:last-child {
    border-bottom: none;
}

.boma-points-earn-list li::marker {
    color: #667eea;
    font-weight: bold;
}

/* Points History Table */
.boma-points-history {
    margin-top: 15px;
}

.boma-points-history th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.boma-points-history td {
    vertical-align: middle;
}

.boma-points-history td.positive {
    color: #28a745;
    font-weight: 600;
}

.boma-points-history td.negative {
    color: #dc3545;
    font-weight: 600;
}

/* Referral Field in Checkout */
#boma_referral_field {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

#boma_referral_field label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

#boma_referral_field input {
    border: 2px solid #e9ecef;
    border-radius: 4px;
    padding: 12px 15px;
    transition: border-color 0.2s ease;
}

#boma_referral_field input:focus {
    border-color: #667eea;
    outline: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .boma-points-summary {
        grid-template-columns: 1fr;
    }

    .boma-points-balance-large .balance {
        font-size: 36px;
    }

    .boma-points-referral .referral-code code {
        font-size: 20px;
    }

    .boma-points-history th,
    .boma-points-history td {
        padding: 10px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .boma-points-dashboard-widget {
        padding: 20px;
    }

    .boma-points-dashboard-widget .boma-points-balance strong {
        font-size: 28px;
    }

    .boma-points-balance-large {
        padding: 20px;
    }

    .boma-points-balance-large .balance {
        font-size: 28px;
    }

    .boma-points-earn-list {
        padding: 15px 15px 15px 30px;
    }

    .boma-points-earn-list li {
        padding: 8px 0;
        font-size: 14px;
    }
}

/* ============================================================
   Shortcode Styles
   ============================================================ */

/* Login Required */
.boma-login-required {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.boma-login-required a {
    color: #667eea;
    font-weight: 600;
}

/* [boma_dashboard] */
.boma-sc-dashboard {
    max-width: 600px;
}

.boma-sc-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.boma-sc-points-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.boma-sc-points-label {
    display: block;
    font-size: 14px;
    opacity: 0.85;
    margin-top: 4px;
}

.boma-sc-tier-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.boma-sc-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.boma-sc-stat {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    text-align: center;
}

.boma-sc-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.boma-sc-stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Progress bar */
.boma-sc-progress {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.boma-sc-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.boma-sc-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.boma-sc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.boma-sc-progress-text {
    font-size: 13px;
    color: #888;
    margin: 8px 0 0;
}

/* Referral in shortcode */
.boma-sc-referral {
    background: #f8f9fa;
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.boma-sc-referral-label {
    font-size: 13px;
    color: #666;
}

.boma-sc-referral-code {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    border: 2px dashed #667eea;
    cursor: pointer;
}

/* [boma_transactions] */
.boma-sc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.boma-sc-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
}

.boma-sc-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.boma-sc-table .positive {
    color: #28a745;
    font-weight: 600;
}

.boma-sc-table .negative {
    color: #dc3545;
    font-weight: 600;
}

.boma-status-approved {
    color: #28a745;
    font-weight: 500;
}

.boma-status-pending {
    color: #ffc107;
    font-weight: 500;
}

.boma-status-rejected {
    color: #dc3545;
    font-weight: 500;
}

.boma-sc-empty {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* [boma_rewards] */
.boma-sc-rewards-balance {
    background: #f0f4ff;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    color: #444;
}

.boma-sc-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.boma-sc-reward-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.boma-sc-reward-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.boma-sc-reward-locked {
    opacity: 0.7;
}

.boma-sc-reward-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.boma-sc-reward-image-placeholder {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    background-image:
        linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%),
        repeating-linear-gradient(45deg, transparent 0 8px, rgba(102,126,234,.06) 8px 16px);
    background-blend-mode: multiply;
}

.boma-sc-reward-info {
    padding: 18px;
}

.boma-sc-reward-name {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.boma-sc-reward-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #777;
}

.boma-sc-reward-cost {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
}

.boma-sc-redeem-btn {
    width: 100%;
    background: #667eea !important;
    color: #fff !important;
    border: none !important;
    padding: 10px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.boma-sc-redeem-btn:hover {
    background: #5a6fd6 !important;
}

.boma-sc-redeem-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.boma-sc-not-enough {
    display: block;
    font-size: 13px;
    color: #999;
    text-align: center;
}

.boma-sc-reward-result {
    padding: 18px;
    border-top: 1px solid #e9ecef;
}

.boma-sc-coupon-result {
    text-align: center;
}

.boma-sc-coupon-success {
    color: #28a745;
    font-weight: 600;
    margin: 0 0 8px;
}

.boma-sc-coupon-code {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    padding: 10px;
    background: #f0f4ff;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
}

.boma-sc-copy-btn {
    font-size: 13px !important;
    padding: 6px 16px !important;
}

/* [boma_tier] */
.boma-sc-current-tier {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.boma-sc-tier-name {
    font-size: 28px;
    font-weight: 700;
}

.boma-sc-tier-multiplier {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 4px;
}

.boma-sc-max-tier {
    text-align: center;
    font-size: 16px;
    color: #28a745;
    font-weight: 600;
    padding: 16px;
    background: #f0fff4;
    border-radius: 8px;
    margin-bottom: 20px;
}

.boma-sc-benefits {
    margin-bottom: 20px;
}

.boma-sc-benefits h4 {
    font-size: 16px;
    margin: 0 0 10px;
}

.boma-sc-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.boma-sc-benefits li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.boma-sc-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Tier ladder */
.boma-sc-tier-ladder h4 {
    font-size: 16px;
    margin: 20px 0 10px;
}

.boma-sc-tier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.boma-sc-tier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.boma-sc-tier-current {
    border-color: #667eea;
    background: #f0f4ff;
}

.boma-sc-tier-reached {
    opacity: 1;
}

.boma-sc-tier-item:not(.boma-sc-tier-reached) {
    opacity: 0.6;
}

.boma-sc-tier-item-name {
    font-weight: 600;
    font-size: 15px;
}

.boma-sc-tier-item-pts {
    font-size: 13px;
    color: #888;
}

.boma-sc-tier-item-mult {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
}

.boma-sc-error {
    color: #dc3545;
    padding: 20px;
    text-align: center;
    background: #fff5f5;
    border-radius: 8px;
}

/* Your Coupons */
.boma-sc-my-coupons {
    margin-top: 30px;
}

.boma-sc-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px;
    color: #333;
}

.boma-sc-coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.boma-sc-coupon-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px;
}

.boma-sc-coupon-expired {
    opacity: 0.6;
}

.boma-sc-coupon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.boma-sc-coupon-header .boma-sc-coupon-code {
    display: inline;
    font-size: 16px;
    margin-bottom: 0;
    padding: 6px 10px;
}

.boma-sc-coupon-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.boma-sc-coupon-amount {
    font-weight: 600;
    color: #333;
}

.boma-sc-coupon-expiry {
    color: #888;
}

.boma-sc-coupon-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.boma-sc-status-active {
    background: #d4edda;
    color: #155724;
}

.boma-sc-status-used {
    background: #f0f0f0;
    color: #888;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .boma-sc-balance-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .boma-sc-points-value {
        font-size: 36px;
    }

    .boma-sc-rewards-grid {
        grid-template-columns: 1fr;
    }

    .boma-sc-referral {
        flex-direction: column;
        text-align: center;
    }

    .boma-sc-tier-item {
        flex-wrap: wrap;
        gap: 4px;
    }
}

@media screen and (max-width: 480px) {
    .boma-sc-stats-grid {
        grid-template-columns: 1fr;
    }

    .boma-sc-points-value {
        font-size: 28px;
    }
}

/* --------------------------------------------------------------------
 * Refresh icon — sits inline next to a points balance number
 * ------------------------------------------------------------------ */

.boma-sc-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

/* On light-backgrounded surfaces, use a dark-on-light chip. (Dashboard widget
 * and balance-large card both have gradient backgrounds, so they keep the
 * default light-on-gradient chip above.) */
.boma-sc-tx-header .boma-sc-refresh-btn,
.boma-sc-rewards-balance .boma-sc-refresh-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: #555;
}

.boma-sc-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.65);
    transform: rotate(30deg);
}

.boma-sc-tx-header .boma-sc-refresh-btn:hover,
.boma-sc-rewards-balance .boma-sc-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #222;
}

.boma-sc-refresh-btn:focus {
    outline: 2px solid rgba(102, 126, 234, 0.6);
    outline-offset: 2px;
}

.boma-sc-refresh-btn .boma-sc-refresh-icon {
    display: block;
    pointer-events: none;
    width: 14px;
    height: 14px;
}

.boma-sc-refresh-btn.is-loading {
    pointer-events: none;
    opacity: 0.75;
}

.boma-sc-refresh-btn.is-loading .boma-sc-refresh-icon {
    animation: boma-sc-spin 0.8s linear infinite;
}

.boma-sc-refresh-btn.is-loading:hover {
    transform: none;
}

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

/* Inline row wrapping the points number + refresh button so they sit side-by-side. */
.boma-sc-value-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.boma-sc-value-row .boma-sc-points-value,
.boma-sc-value-row .balance,
.boma-sc-value-row > strong {
    display: inline-block;
    margin-bottom: 0;
}

/* Transactions / rewards have no balance number → subtle label-style header for the button. */
.boma-sc-tx-header,
.boma-sc-rewards-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.boma-sc-tx-header {
    margin-bottom: 8px;
    font-size: 13px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
