/**
 * Barlaz Referral & Rewards - Frontend Stylesheet
 */

:root {
    --barlaz-primary: #4f46e5;
    --barlaz-primary-hover: #4338ca;
    --barlaz-secondary: #0ea5e9;
    --barlaz-success: #10b981;
    --barlaz-success-bg: #ecfdf5;
    --barlaz-warning: #f59e0b;
    --barlaz-warning-bg: #fffbeb;
    --barlaz-danger: #ef4444;
    --barlaz-danger-bg: #fef2f2;
    --barlaz-dark: #0f172a;
    --barlaz-gray-50: #f8fafc;
    --barlaz-gray-100: #f1f5f9;
    --barlaz-gray-200: #e2e8f0;
    --barlaz-gray-300: #cbd5e1;
    --barlaz-gray-600: #475569;
    --barlaz-gray-700: #334155;
    --barlaz-gray-900: #0f172a;
    --barlaz-radius: 12px;
    --barlaz-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --barlaz-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.barlaz-referral-wrapper,
.barlaz-wallet-wrapper {
    font-family: inherit;
    color: var(--barlaz-gray-900);
    margin: 20px 0;
}

/* ==========================================================
   Hero Cards
========================================================== */
.barlaz-hero-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
    border-radius: var(--barlaz-radius);
    padding: 32px 36px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    box-shadow: var(--barlaz-shadow-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.barlaz-hero-card::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.barlaz-hero-content {
    max-width: 60%;
}

.barlaz-hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #e0e7ff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.barlaz-hero-title {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    margin: 0 0 10px 0 !important;
}

.barlaz-hero-subtitle {
    color: #c7d2fe;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.barlaz-hero-balance-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px 24px;
    text-align: right;
    min-width: 210px;
}

.barlaz-balance-label {
    display: block;
    font-size: 12px;
    color: #c7d2fe;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.barlaz-balance-value,
.barlaz-wallet-big-balance {
    font-size: 32px;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    margin-bottom: 10px;
}

.barlaz-btn-balance-link {
    display: inline-block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.barlaz-btn-balance-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Wallet Hero Variation */
.barlaz-wallet-hero {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 60%, #059669 100%);
}

.barlaz-wallet-hero .barlaz-wallet-big-balance {
    color: #34d399;
}

.barlaz-wallet-usage-notice {
    color: #a7f3d0;
    font-size: 14px;
    margin: 8px 0 0 0;
}

.barlaz-hero-action-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.barlaz-btn-shop-now {
    background: #ffffff;
    color: #065f46;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.barlaz-btn-shop-now:hover {
    background: #ecfdf5;
    transform: translateY(-2px);
    color: #047857;
}

.barlaz-btn-outline-earn {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.barlaz-btn-outline-earn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* ==========================================================
   Stats Grid
========================================================== */
.barlaz-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.barlaz-stat-card {
    background: #ffffff;
    border: 1px solid var(--barlaz-gray-200);
    border-radius: var(--barlaz-radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--barlaz-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.barlaz-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--barlaz-shadow-lg);
}

.barlaz-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.barlaz-stat-icon-blue { background: #eff6ff; color: #2563eb; }
.barlaz-stat-icon-yellow { background: #fffbeb; color: #d97706; }
.barlaz-stat-icon-green { background: #ecfdf5; color: #059669; }

.barlaz-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--barlaz-gray-600);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.barlaz-stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--barlaz-gray-900);
    line-height: 1.1;
}

.barlaz-stat-sub {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ==========================================================
   Cards General
========================================================== */
.barlaz-card {
    background: #ffffff;
    border: 1px solid var(--barlaz-gray-200);
    border-radius: var(--barlaz-radius);
    padding: 28px;
    box-shadow: var(--barlaz-shadow);
    margin-bottom: 24px;
}

.barlaz-card-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--barlaz-gray-900) !important;
    margin: 0 0 6px 0 !important;
}

.barlaz-card-desc {
    color: var(--barlaz-gray-600);
    font-size: 14px;
    margin: 0 0 20px 0;
}

/* ==========================================================
   Share Boxes & Copy buttons
========================================================== */
.barlaz-share-boxes {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.barlaz-copy-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--barlaz-gray-700);
    margin-bottom: 6px;
}

.barlaz-copy-box {
    display: flex;
    background: var(--barlaz-gray-50);
    border: 1px solid var(--barlaz-gray-300);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.barlaz-copy-box:focus-within {
    border-color: var(--barlaz-primary);
}

.barlaz-copy-box input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-family: monospace;
    color: var(--barlaz-gray-900) !important;
    box-shadow: none !important;
    outline: none !important;
}

.barlaz-btn-copy {
    background: var(--barlaz-primary);
    color: #ffffff;
    border: none;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.barlaz-btn-copy:hover {
    background: var(--barlaz-primary-hover);
}

.barlaz-btn-copy.barlaz-copied {
    background: var(--barlaz-success);
}

/* Social Share */
.barlaz-social-share {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--barlaz-gray-200);
}

.barlaz-social-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--barlaz-gray-600);
}

.barlaz-social-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.barlaz-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: transform 0.2s, filter 0.2s;
}

.barlaz-social-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.barlaz-btn-whatsapp { background: #25D366; }
.barlaz-btn-facebook { background: #1877F2; }
.barlaz-btn-telegram { background: #229ED9; }
.barlaz-btn-twitter  { background: #000000; }

/* ==========================================================
   Workflow Steps
========================================================== */
.barlaz-steps-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.barlaz-step-item {
    flex: 1;
    min-width: 160px;
    background: var(--barlaz-gray-50);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.barlaz-step-badge {
    width: 32px;
    height: 32px;
    background: var(--barlaz-primary);
    color: #ffffff;
    font-weight: 800;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.barlaz-step-badge-success {
    background: var(--barlaz-success);
}

.barlaz-step-item h4 {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
}

.barlaz-step-item p {
    font-size: 12px;
    color: var(--barlaz-gray-600);
    line-height: 1.4;
    margin: 0;
}

.barlaz-step-divider {
    font-size: 20px;
    color: var(--barlaz-gray-300);
    font-weight: bold;
}

/* ==========================================================
   Data Tables
========================================================== */
.barlaz-table-responsive {
    overflow-x: auto;
}

.barlaz-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.barlaz-data-table th {
    background: var(--barlaz-gray-50);
    color: var(--barlaz-gray-600);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--barlaz-gray-200);
}

.barlaz-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--barlaz-gray-200);
    vertical-align: middle;
}

.barlaz-user-cell strong {
    display: block;
    color: var(--barlaz-gray-900);
}

.barlaz-subtext {
    font-size: 12px;
    color: #64748b;
}

.barlaz-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.barlaz-badge-pending  { background: var(--barlaz-warning-bg); color: #b45309; }
.barlaz-badge-approved { background: var(--barlaz-success-bg); color: #047857; }
.barlaz-badge-rejected { background: var(--barlaz-danger-bg);  color: #b91c1c; }

.barlaz-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--barlaz-gray-100);
    color: var(--barlaz-gray-700);
}

.barlaz-tx-amount {
    font-weight: 700;
    font-size: 15px;
}

.barlaz-amount-credit { color: #059669; }
.barlaz-amount-debit  { color: #dc2626; }

.barlaz-alert-banner {
    display: flex;
    gap: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #166534;
}

.barlaz-alert-banner p {
    margin: 4px 0 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.barlaz-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.barlaz-empty-state svg {
    margin-bottom: 12px;
    stroke: #cbd5e1;
}

/* ==========================================================
   Checkout & Cart Wallet Widget
========================================================== */
.barlaz-checkout-wallet-box {
    background: #f8fafc;
    border: 1.5px dashed #6366f1;
    border-radius: var(--barlaz-radius);
    padding: 18px 22px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.barlaz-wallet-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.barlaz-wallet-box-icon {
    width: 44px;
    height: 44px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.barlaz-wallet-box-info h4 {
    margin: 0 0 4px 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--barlaz-gray-900) !important;
}

.barlaz-wallet-box-info p {
    margin: 0 !important;
    font-size: 13px !important;
    color: var(--barlaz-gray-600) !important;
}

.barlaz-limit-hint {
    color: #6366f1;
    font-weight: 600;
}

.barlaz-btn-apply-wallet {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    white-space: nowrap !important;
}

.barlaz-btn-apply-wallet:hover {
    background: #4338ca !important;
    transform: translateY(-1px);
}

.barlaz-wallet-applied-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
}

.barlaz-btn-remove-wallet {
    background: transparent !important;
    color: #dc2626 !important;
    border: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    padding: 0 !important;
}

/* ==========================================================
   Auth Form / OTP Popup
========================================================== */
.barlaz-registration-fields {
    margin: 18px 0;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.barlaz-phone-input-wrap,
.barlaz-otp-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.barlaz-phone-prefix {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    border-right: 1px solid #cbd5e1;
}

.barlaz-phone-input-wrap input,
.barlaz-otp-input-wrap input {
    flex: 1;
    border: none !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    outline: none !important;
}

.barlaz-btn-send-otp,
.barlaz-btn-verify-otp {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background 0.2s !important;
}

.barlaz-btn-send-otp:hover,
.barlaz-btn-verify-otp:hover {
    background: #4338ca !important;
}

.barlaz-field-hint {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.barlaz-field-success {
    display: block;
    color: #059669;
    font-size: 12px;
    margin-top: 4px;
}

.barlaz-otp-status-msg {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}

.barlaz-otp-status-msg.success { color: #059669; }
.barlaz-otp-status-msg.error   { color: #dc2626; }

/* Toast Notifications */
.barlaz-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-size: 14px;
    font-weight: 600;
    z-index: 999999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.barlaz-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .barlaz-hero-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
    .barlaz-hero-content {
        max-width: 100%;
    }
    .barlaz-hero-balance-box {
        width: 100%;
        text-align: left;
    }
    .barlaz-share-boxes {
        grid-template-columns: 1fr;
    }
    .barlaz-steps-container {
        flex-direction: column;
    }
    .barlaz-step-divider {
        transform: rotate(90deg);
    }
    .barlaz-checkout-wallet-box {
        flex-direction: column;
        align-items: flex-start;
    }
}
