/* =============================================
   WHOLESALE CHANNEL — Dark Messenger Theme
   ============================================= */

/* === LOGIN PAGE === */
.ws-login-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b141a 0%, #1a2332 100%);
    padding: 40px 16px;
}

.ws-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.ws-login-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #25d366);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: #fff;
}

.ws-login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.ws-login-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.ws-login-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: left;
}

.ws-login-form {
    margin-bottom: 24px;
}

.ws-login-input-wrap {
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ws-login-input-wrap:focus-within {
    border-color: #1e40af;
}

.ws-login-input-wrap input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    min-width: 0;
}

.ws-login-submit {
    background: linear-gradient(135deg, #1e40af, #25d366);
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.ws-login-submit:hover {
    opacity: 0.85;
}

.ws-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #15803d;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid #bbf7d0;
}

/* === 3-STEP PROGRESS INDICATOR === */
.ws-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 8px;
}

.ws-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.ws-progress-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid #d1d5db;
    color: #9ca3af;
    background: #fff;
    transition: all 0.3s;
}

.ws-progress-step.complete .ws-progress-circle {
    background: linear-gradient(135deg, #1e40af, #25d366);
    border-color: #25d366;
    color: #fff;
    font-size: 0.7rem;
}

.ws-progress-step.active .ws-progress-circle {
    border-color: #1e40af;
    color: #1e40af;
    background: #eff6ff;
    animation: ws-pulse 2s infinite;
}

.ws-progress-step.pending .ws-progress-circle {
    border-color: #e5e7eb;
    color: #d1d5db;
}

.ws-progress-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
}

.ws-progress-step.complete .ws-progress-label {
    color: #1e40af;
}

.ws-progress-step.active .ws-progress-label {
    color: #1e40af;
}

.ws-progress-line {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 6px;
    margin-bottom: 22px;
    transition: background 0.3s;
}

.ws-progress-line.complete {
    background: linear-gradient(90deg, #25d366, #1e40af);
}

.ws-progress-line.active {
    background: linear-gradient(90deg, #1e40af, #e5e7eb);
}

@keyframes ws-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(30,64,175,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(30,64,175,0); }
}


/* === OTP PAGE === */
.ws-otp-page .ws-login-card {
    max-width: 440px;
}

.ws-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.ws-otp-inputs input {
    width: 48px;
    height: 56px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    color: #111;
}

.ws-otp-inputs input:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.15);
    background: #fff;
}

.ws-otp-inputs input:not(:placeholder-shown) {
    border-color: #25d366;
    background: #eff6ff;
}

.ws-otp-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e40af, #25d366);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 16px;
}

.ws-otp-submit:hover {
    opacity: 0.85;
}

.ws-otp-countdown {
    font-size: 0.82rem;
    color: #666;
    margin-bottom: 12px;
}

.ws-otp-countdown i {
    color: #1e40af;
}

.ws-otp-resend {
    margin-bottom: 8px;
}

.ws-otp-resend-btn {
    background: none;
    border: none;
    color: #1e40af;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.ws-otp-resend-btn:hover {
    color: #1e3a8a;
}


/* === NO INVITE STATE === */
.ws-no-invite-icon {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.ws-no-invite-info {
    margin-bottom: 24px;
}

.ws-no-invite-security {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.ws-security-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
    text-align: left;
}

.ws-security-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #25d366);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ws-no-invite-contact {
    margin-bottom: 20px;
}

.ws-contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ws-contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #1e40af;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ws-contact-links a:hover {
    background: #dcfce7;
    border-color: #1e40af;
}


/* === LOCKED / TIER-GATED MESSAGES === */
.ws-message-locked .ws-bubble {
    position: relative;
    overflow: hidden;
}

.ws-message-locked .ws-text {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

.ws-message-locked .ws-sender {
    filter: blur(0);
}

.ws-message-locked .ws-time {
    filter: blur(0);
}

.ws-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    border-radius: inherit;
    z-index: 2;
    gap: 6px;
    padding: 12px;
}

.ws-locked-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 1.1rem;
    border: 1px solid rgba(245,158,11,0.3);
}

.ws-locked-label {
    color: #f59e0b;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.ws-locked-upgrade {
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    text-align: center;
}

/* Tier badge on premium messages */
.ws-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.ws-tier-badge-premium {
    background: rgba(30,64,175,0.15);
    color: #1e40af;
    border: 1px solid rgba(30,64,175,0.3);
}

.ws-tier-badge-elite {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
}

.ws-tier-badge-platinum {
    background: rgba(168,85,247,0.15);
    color: #a855f7;
    border: 1px solid rgba(168,85,247,0.3);
}

/* Hide reactions on locked messages */
.ws-message-locked .ws-reactions {
    display: none;
}


/* === CHANNEL PAGE === */
.ws-channel {
    background: #0b141a;
    min-height: 100vh;
}

/* Channel Header */
.ws-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1f2c34;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ws-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
}

.ws-header-info {
    flex: 1;
}

.ws-header-name {
    color: #e9edef;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-header-name .ws-lock-icon {
    color: #25d366;
    font-size: 0.75rem;
}

.ws-header-members {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.ws-header-logout {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ws-header-logout:hover {
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.85);
}

/* User Tier Badge in header */
.ws-header-tier {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ws-header-tier-standard { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.ws-header-tier-premium { background: rgba(30,64,175,0.15); color: #1e40af; border: 1px solid rgba(30,64,175,0.3); }
.ws-header-tier-elite { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.ws-header-tier-platinum { background: rgba(168,85,247,0.15); color: #a855f7; border: 1px solid rgba(168,85,247,0.3); }

/* Encryption Badge */
.ws-encryption-badge {
    text-align: center;
    padding: 10px 16px;
    background: #1f2c34;
}

.ws-encryption-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.35);
    font-size: 0.72rem;
    padding: 5px 14px;
    border-radius: 8px;
}

/* Pinned Messages */
.ws-pinned {
    background: #1a2530;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ws-pinned-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.ws-pinned-header:hover {
    background: rgba(255,255,255,0.03);
}

.ws-pinned-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #25d366;
    font-size: 0.85rem;
    font-weight: 600;
}

.ws-pinned-chevron {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.ws-pinned-chevron.open {
    transform: rotate(180deg);
}

.ws-pinned-body {
    padding: 0 20px 14px;
    display: none;
}

.ws-pinned-body.open {
    display: block;
}

.ws-pinned-msg {
    background: rgba(255,255,255,0.04);
    border-left: 3px solid #25d366;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin-bottom: 8px;
    color: #e9edef;
    font-size: 0.84rem;
    line-height: 1.5;
}

.ws-pinned-msg:last-child {
    margin-bottom: 0;
}

.ws-pinned-msg strong {
    color: #25d366;
}

/* Chat Messages */
.ws-chat {
    padding: 16px 20px 30px;
    max-width: 900px;
    margin: 0 auto;
}

/* Date Divider */
.ws-date-divider {
    text-align: center;
    padding: 16px 0 8px;
}

.ws-date-divider span {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 16px;
    border-radius: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Message Bubble */
.ws-message {
    margin-bottom: 4px;
    max-width: 85%;
}

.ws-bubble {
    background: #005c4b;
    border-radius: 0 8px 8px 8px;
    padding: 8px 12px 6px;
    position: relative;
}

.ws-message:first-child .ws-bubble,
.ws-date-divider + .ws-message .ws-bubble {
    border-radius: 8px 8px 8px 0;
}

.ws-sender {
    color: #25d366;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.ws-text {
    color: #e9edef;
    font-size: 0.9rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.ws-text a {
    color: #53bdeb;
    text-decoration: underline;
}

.ws-text strong, .ws-text b {
    font-weight: 700;
}

.ws-time {
    text-align: right;
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
    margin-top: 2px;
}

/* Reactions */
.ws-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 8px;
    align-items: center;
}

.ws-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ws-reaction:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.18);
}

.ws-reaction:active {
    transform: scale(0.95);
}

.ws-reaction.reacted {
    background: rgba(37, 211, 102, 0.15);
    border-color: #25d366;
    color: #e9edef;
}

.ws-reaction.reacted:hover {
    background: rgba(37, 211, 102, 0.22);
}

.ws-reaction-emoji {
    font-size: 0.85rem;
}

.ws-reaction-count {
    font-variant-numeric: tabular-nums;
}

/* Reaction Add Button */
.ws-reaction-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ws-reaction-add:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
}

/* Emoji Picker */
.ws-emoji-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    background: #1f2c34;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 6px 8px;
    gap: 2px;
    z-index: 50;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.ws-emoji-picker.open {
    display: flex;
}

.ws-emoji-picker span {
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1;
}

.ws-emoji-picker span:hover {
    background: rgba(255,255,255,0.1);
}

/* Encryption Footer */
.ws-encryption-footer {
    text-align: center;
    padding: 30px 16px 40px;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}


/* === RESPONSIVE === */
@media (max-width: 600px) {
    .ws-login-card {
        padding: 36px 24px;
        margin: 0 8px;
    }

    .ws-header {
        padding: 10px 14px;
    }

    .ws-header-avatar {
        width: 38px;
        height: 38px;
    }

    .ws-header-name {
        font-size: 0.95rem;
    }

    .ws-header-logout span {
        display: none;
    }

    .ws-chat {
        padding: 12px 10px 30px;
    }

    .ws-message {
        max-width: 95%;
    }

    .ws-pinned-header {
        padding: 10px 14px;
    }

    .ws-pinned-body {
        padding: 0 14px 10px;
    }

    .ws-otp-inputs input {
        width: 40px;
        height: 48px;
        font-size: 1.2rem;
    }

    .ws-progress-line {
        width: 24px;
    }

    .ws-progress-circle {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .ws-progress-label {
        font-size: 0.6rem;
    }
}

/* Hide site chrome on wholesale page (JS handles hiding, this is fallback) */
body:has(.ws-channel) .trust-bar,
body:has(.ws-channel) > header.header,
body:has(.ws-channel) .mobile-bottom-nav,
body:has(.ws-channel) .mobile-menu-overlay,
body:has(.ws-channel) .mobile-menu,
body:has(.ws-channel) > div[style*="background:#dc2626"] {
    display: none !important;
}

/* Ensure main content has no padding/margin interfering with sticky */
body:has(.ws-channel) #main-content {
    padding: 0;
    margin: 0;
}
