/* ============================================
   WOOCOMMERCE REFERRAL SYSTEM PRO - FRONTEND CSS
   ============================================ */

.wcrs-referral-box,
.wcrs-referral-box *,
.wcrs-leaderboard,
.wcrs-leaderboard *,
.wcrs-auth-modal,
.wcrs-auth-modal * {
    box-sizing: border-box;
}

/* ----- Referral Box Base ----- */
.wcrs-referral-box {
    position: relative;
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 14px;
    margin: 16px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1.5px solid #eef2f6;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wcrs-referral-box:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    border-color: #dce3ec;
}

/* ----- Guest Box (Elegant & Compact) ----- */
.wcrs-referral-box.wcrs-guest {
    padding: 18px 22px;
    text-align: center;
    background: linear-gradient(135deg, #fafcff 0%, #f2f7ff 100%);
    border-color: #dde7f5;
}

.wcrs-referral-box.wcrs-guest .wcrs-message {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin: 0 0 4px 0;
    letter-spacing: -0.2px;
}

.wcrs-referral-box.wcrs-guest .wcrs-earnings {
    font-size: 15px;
    font-weight: 500;
    color: #0f172a;
    background: rgba(79, 172, 254, 0.08);
    padding: 6px 14px;
    border-radius: 30px;
    display: inline-block;
    border: none;
    margin: 6px 0 10px 0;
    border-left: none;
}

.wcrs-referral-box.wcrs-guest .wcrs-earnings strong {
    color: #1e4f8a;
    font-weight: 700;
}

.wcrs-referral-box.wcrs-guest .wcrs-login-link {
    display: inline-block;
    margin-top: 2px;
    padding: 8px 28px;
    background: #1a56db;
    color: #ffffff !important;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(26, 86, 219, 0.25);
    letter-spacing: 0.3px;
}

.wcrs-referral-box.wcrs-guest .wcrs-login-link:hover {
    background: #1a3f8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 86, 219, 0.35);
}

/* Hide icon in guest box */
.wcrs-referral-box.wcrs-guest .wcrs-icon {
    display: none !important;
}

/* ----- Logged-in Box ----- */
.wcrs-referral-box.wcrs-loggedin {
    padding: 18px 22px;
    background: #ffffff;
}

.wcrs-referral-box .wcrs-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcrs-referral-box .wcrs-title::before {
    content: '🔗';
    font-size: 18px;
}

.wcrs-link-copy {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 6px 0 10px 0;
}

.wcrs-link-copy input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    background: #f8fafc;
    transition: border 0.2s, box-shadow 0.2s;
    color: #1e293b;
}

.wcrs-link-copy input:focus {
    border-color: #1a56db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.wcrs-copy-btn {
    background: #1a56db;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.2);
    white-space: nowrap;
}

.wcrs-copy-btn:hover {
    background: #143d8a;
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.3);
}

.wcrs-bonus {
    font-size: 12px;
    color: #64748b;
    margin: -4px 0 8px 0;
}

.wcrs-social-share {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wcrs-share-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #94a3b8;
}

.wcrs-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #ffffff !important;
}

.wcrs-share-facebook { background: #1877f2; }
.wcrs-share-twitter  { background: #000000; }
.wcrs-share-linkedin { background: #0077b5; }
.wcrs-share-whatsapp { background: #25d366; }

/* ----- Error ----- */
.wcrs-error {
    color: #b91c1c;
    padding: 8px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    margin: 8px 0;
    font-size: 14px;
}

/* ============================================
   CUSTOM AUTH MODAL STYLES
   ============================================ */

#wcrs-auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#wcrs-auth-modal-box {
    background: #ffffff;
    max-width: 400px;
    width: 92%;
    padding: 28px 24px;
    border-radius: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    animation: wcrsModalIn 0.3s ease;
}

@keyframes wcrsModalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#wcrs-auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    line-height: 1;
    padding: 0 4px;
    z-index: 10;
}

#wcrs-auth-modal-close:hover {
    color: #0f172a;
    transform: rotate(90deg);
}

.wcrs-auth-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.wcrs-auth-tab {
    flex: 1;
    padding: 1px 2px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wcrs-auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin:0px;
}

.wcrs-auth-tab:hover:not(.active) {
    color: #0f172a;
}

.wcrs-auth-forms {
    position: relative;
}

.wcrs-auth-form {
    display: none;
    animation: wcrsFormIn 0.25s ease;
}

.wcrs-auth-form.active {
    display: block;
}

@keyframes wcrsFormIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcrs-auth-message {
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    display: none;
}

.wcrs-auth-message.error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    display: block;
}

.wcrs-auth-message.success {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    display: block;
}

.wcrs-form-group {
    margin-bottom: 14px;
}

.wcrs-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.wcrs-form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #0f172a;
}

.wcrs-form-group input:focus {
    border-color: #1a56db;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.wcrs-form-group input::placeholder {
    color: #94a3b8;
}

.wcrs-form-actions {
    margin-top: 16px;
}

.wcrs-auth-submit {
    width: 100%;
    padding: 10px 20px;
    background: #1a56db;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(26, 86, 219, 0.2);
}

.wcrs-auth-submit:hover {
    background: #143d8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 86, 219, 0.3);
}

.wcrs-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wcrs-auth-links {
    text-align: center;
    margin-top: 10px;
}

.wcrs-auth-links a {
    color: #1a56db;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.wcrs-auth-links a:hover {
    color: #143d8a;
    text-decoration: underline;
}

/* ============================================
   FRONTEND DASHBOARD (My Account)
   ============================================ */

.wcrs-frontend-wrap {
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.wcrs-tabs {
    display: flex;
    border-bottom: 2px solid #e9edf2;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wcrs-tabs a {
    padding: 8px 18px;
    text-decoration: none !important;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.wcrs-tabs a.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}

.wcrs-tabs a:hover {
    color: #1a56db;
}

.wcrs-stats-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.wcrs-stats-grid .stat-box {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 10px;
    flex: 1;
    min-width: 100px;
    text-align: center;
    border: 1px solid #e9edf2;
}

.wcrs-stats-grid .stat-box strong {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wcrs-stats-grid .stat-box {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.wcrs-rank-box {
    background: linear-gradient(135deg, #f8fafc, #eef2f6);
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #f59e0b;
}

.wcrs-rank-box h3 {
    margin: 0 0 3px 0;
    font-size: 15px;
    font-weight: 600;
}

.wcrs-rank-box p {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

.wcrs-notifications ul {
    list-style: none;
    padding: 0;
}

.wcrs-notifications li {
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid #cbd5e1;
}

.wcrs-notifications li.unread {
    background: #eff6ff;
    border-left-color: #1a56db;
}

.wcrs-notifications li.read {
    background: #f1f5f9;
    border-left-color: #94a3b8;
}

.wcrs-notifications li strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.wcrs-notifications li p {
    margin: 3px 0 4px 0;
    color: #334155;
    font-size: 13px;
}

.wcrs-notifications li small {
    color: #94a3b8;
    font-size: 11px;
}

.wcrs-unread-badge {
    background: #dc2626;
    color: #fff;
    border-radius: 50px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
    line-height: 20px;
}

.wcrs-mark-read {
    background: none;
    border: none;
    color: #1a56db;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    margin-top: 2px;
}

.wcrs-mark-read:hover {
    text-decoration: underline;
}

.wcrs-leaderboard {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.wcrs-leaderboard th {
    background: #f1f5f9;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #e2e8f0;
}

.wcrs-leaderboard td {
    padding: 6px 12px;
    border-bottom: 1px solid #eef2f6;
    font-size: 13px;
}

.wcrs-leaderboard tr:hover {
    background: #f8fafc;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .wcrs-referral-box {
        padding: 16px 18px;
    }
    .wcrs-referral-box.wcrs-guest {
        padding: 14px 16px;
    }
    .wcrs-link-copy {
        flex-direction: column;
        align-items: stretch;
    }
    .wcrs-link-copy input {
        min-width: auto;
        width: 100%;
    }
    .wcrs-copy-btn {
        width: 100%;
        text-align: center;
    }
    .wcrs-stats-grid .stat-box {
        min-width: 70px;
        font-size: 16px;
        padding: 10px 12px;
    }
    .wcrs-tabs a {
        padding: 6px 12px;
        font-size: 13px;
    }
    #wcrs-auth-modal-box {
        padding: 18px 16px;
    }
    .wcrs-auth-tab {
        font-size: 13px;
        padding: 6px 10px;
    }
    .wcrs-form-group input {
        padding: 6px 10px;
        font-size: 13px;
    }
    .wcrs-auth-submit {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .wcrs-referral-box .wcrs-title {
        font-size: 15px;
    }
    .wcrs-referral-box.wcrs-guest .wcrs-login-link {
        padding: 6px 20px;
        font-size: 13px;
    }
    .wcrs-referral-box.wcrs-guest .wcrs-earnings {
        font-size: 13px;
        padding: 4px 12px;
    }
}