/* ==========================================================================
   WeCatchAI Referral Reward Modal Styles
   Matches Homepage Modal Design System & Components
   ========================================================================== */

/* --- Overlay & Backdrop --- */
.wcr-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
}

.wcr-modal-overlay.wcr-open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* --- Card Container --- */
.wcr-modal-card {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 22px;
    width: 100%;
    max-width: 530px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    padding: 2.25rem 2rem 1.85rem 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.wcr-modal-overlay.wcr-open .wcr-modal-card {
    transform: translateY(0) scale(1);
}

/* Custom Scrollbar for Card */
.wcr-modal-card::-webkit-scrollbar {
    width: 6px;
}
.wcr-modal-card::-webkit-scrollbar-track {
    background: transparent;
}
.wcr-modal-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.wcr-modal-card::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Close Button --- */
.wcr-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b !important;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.wcr-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a !important;
    transform: rotate(90deg);
}

/* --- Header Section --- */
.wcr-modal-header {
    margin-bottom: 1.15rem;
    padding-right: 2.5rem; /* prevent overlap with close button */
}

.wcr-header-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wcr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.08) !important;
    color: #2563eb !important;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 9999px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wcr-badge-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: wcrPulseDot 2s infinite;
}

@keyframes wcrPulseDot {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.wcr-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a !important;
    line-height: 1.25;
    margin: 0.5rem 0 0.35rem 0;
    letter-spacing: -0.02em;
}

.wcr-subtitle {
    color: #475569 !important;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

.wcr-subtitle strong {
    color: #0f172a !important;
    font-weight: 700;
}

/* --- Hero Highlight Banner --- */
.wcr-hero-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 45%, #eff6ff 100%);
    border: 1.5px solid #86efac;
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    margin: 1.15rem 0 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
}

.wcr-hero-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.wcr-hero-amount {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    color: #059669 !important;
    letter-spacing: -0.03em;
}

.wcr-hero-reward-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #065f46 !important;
}

.wcr-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.wcr-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #059669 !important;
    color: #ffffff !important;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 9px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.wcr-hero-desc {
    font-size: 0.78rem;
    color: #047857 !important;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Step Breakdown (Matching Homepage .reward-breakdown) --- */
.wcr-breakdown {
    margin-bottom: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.wcr-step-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    transition: transform 0.2s ease, background 0.2s ease;
}

.wcr-step-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.wcr-step-item.wcr-highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: #93c5fd;
    border-left: 4px solid #10b981;
}

.wcr-step-icon {
    font-size: 1.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.wcr-step-text {
    flex: 1;
    font-size: 0.86rem;
    color: #334155 !important;
    line-height: 1.4;
}

.wcr-step-text strong {
    color: #0f172a !important;
    font-weight: 700;
    display: block;
    margin-bottom: 1px;
}

/* --- Referral Link Section (Matching Homepage .link-input-group) --- */
.wcr-link-section {
    margin-bottom: 1.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.15rem;
}

.wcr-link-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569 !important;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wcr-input-group {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.wcr-link-input {
    flex: 1;
    padding: 0.72rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: all;
    min-width: 0;
}

.wcr-link-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wcr-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.72rem 1.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none;
    border-radius: 10px;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.wcr-copy-btn span,
.wcr-copy-btn svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.wcr-copy-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wcr-copy-btn:active {
    transform: translateY(0);
}

.wcr-copy-feedback {
    display: none;
    align-items: center;
    gap: 6px;
    color: #059669 !important;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.35rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    border-left: 3px solid #10b981;
}

/* Guest State Box */
.wcr-guest-box {
    text-align: center;
    padding: 0.25rem 0;
}

.wcr-guest-text {
    font-size: 0.88rem;
    color: #475569 !important;
    margin: 0.4rem 0 0.85rem 0;
    line-height: 1.4;
}

.wcr-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.72rem 1.4rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    width: 100%;
}

.wcr-signin-btn span {
    color: #ffffff !important;
}

.wcr-signin-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* --- Social Share Section (Matching Homepage .share-section) --- */
.wcr-share-section {
    margin-bottom: 1.25rem;
}

.wcr-share-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569 !important;
    margin: 0 0 0.65rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wcr-share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
}

.wcr-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.wcr-share-btn span {
    color: #ffffff !important;
}

.wcr-share-btn svg {
    width: 16px;
    height: 16px;
    fill: #ffffff !important;
    flex-shrink: 0;
}

.wcr-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.wcr-share-btn.wcr-whatsapp {
    background: #25d366 !important;
}
.wcr-share-btn.wcr-whatsapp:hover {
    background: #20bd5a !important;
}

.wcr-share-btn.wcr-twitter {
    background: #0f1419 !important;
}
.wcr-share-btn.wcr-twitter:hover {
    background: #272c30 !important;
}

.wcr-share-btn.wcr-linkedin {
    background: #0077b5 !important;
}
.wcr-share-btn.wcr-linkedin:hover {
    background: #00669c !important;
}

.wcr-share-btn.wcr-facebook {
    background: #1877f2 !important;
}
.wcr-share-btn.wcr-facebook:hover {
    background: #166fe5 !important;
}

/* --- Footer Guarantee Notice --- */
.wcr-footer-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #64748b !important;
    text-align: center;
    line-height: 1.4;
}

.wcr-footer-notice span {
    color: #64748b !important;
}

.wcr-footer-notice svg {
    width: 14px;
    height: 14px;
    color: #10b981 !important;
    stroke: #10b981 !important;
    flex-shrink: 0;
}

/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
body:not(.light-homepage):not(.light-theme-page) .wcr-modal-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

body:not(.light-homepage):not(.light-theme-page) .wcr-title {
    color: #ffffff !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-subtitle {
    color: #cbd5e1 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-subtitle strong {
    color: #ffffff !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-close-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-hero-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
    border-color: rgba(16, 185, 129, 0.35);
}

body:not(.light-homepage):not(.light-theme-page) .wcr-hero-amount {
    color: #34d399 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-hero-reward-text {
    color: #6ee7b7 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-hero-desc {
    color: #a7f3d0 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-step-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: #3b82f6;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-step-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body:not(.light-homepage):not(.light-theme-page) .wcr-step-item.wcr-highlight {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    border-left-color: #10b981;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-step-text {
    color: #cbd5e1 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-step-text strong {
    color: #ffffff !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-link-section {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

body:not(.light-homepage):not(.light-theme-page) .wcr-link-label {
    color: #94a3b8 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-link-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-guest-text {
    color: #94a3b8 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-share-title {
    color: #94a3b8 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-footer-notice {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8 !important;
}

body:not(.light-homepage):not(.light-theme-page) .wcr-footer-notice span {
    color: #94a3b8 !important;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 540px) {
    .wcr-modal-card {
        padding: 2rem 1.25rem 1.5rem 1.25rem;
        border-radius: 18px;
    }

    .wcr-modal-header {
        padding-right: 2.25rem;
    }

    .wcr-close-btn {
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
    }

    .wcr-title {
        font-size: 1.25rem;
    }

    .wcr-hero-amount {
        font-size: 1.95rem;
    }

    .wcr-hero-banner {
        padding: 0.95rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .wcr-hero-right {
        align-items: flex-start;
        text-align: left;
    }

    .wcr-share-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wcr-input-group {
        flex-direction: column;
    }

    .wcr-copy-btn {
        width: 100%;
        padding: 0.75rem;
    }
}
