/* Whop User Integration Styles - Theme Compatible */

.wallet-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 8px 0;
}

.wallet-dropdown-section {
    padding: 8px 0;
}

.wallet-dropdown-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Subtle status display - less prominent */
.whop-status-subtle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.whop-status-subtle-icon {
    font-size: 14px;
    line-height: 1;
    color: var(--dx-emerald);
    opacity: 0.8;
}

.whop-status-subtle-text {
    flex: 1;
    color: var(--text-dim);
}

.whop-status-subtle-pending .whop-status-subtle-icon {
    color: var(--dx-gold);
}

.whop-status-subtle-inactive {
    align-items: flex-start;
    padding: 10px 16px;
}

.whop-status-subtle-inactive .whop-status-subtle-icon {
    color: var(--dx-gold);
    margin-top: 2px;
}

.whop-status-subtle-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.whop-status-subtle-inactive .whop-status-subtle-text {
    color: var(--text);
    font-weight: 500;
}

.whop-payment-instructions {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.whop-payment-instructions small {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.whop-payment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.whop-payment-link:hover {
    background: var(--bg-elev);
    border-color: var(--dx-cyan);
    color: var(--dx-cyan);
    transform: translateX(2px);
}

.whop-payment-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    text-align: left;
}

.whop-payment-link-btn:hover {
    background: var(--bg-elev);
    border-color: var(--dx-cyan);
    color: var(--dx-cyan);
    transform: translateX(2px);
}

.whop-verify-btn-inline {
    margin-left: auto;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.whop-verify-btn-inline:hover {
    background: var(--surface);
    border-color: var(--dx-cyan);
    color: var(--text);
}

/* Legacy styles for backward compatibility */
.whop-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin: 8px 0;
    line-height: 1.5;
}

.whop-status-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.whop-status-text strong {
    font-weight: 600;
    display: block;
}

.whop-status-verified {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--dx-emerald);
}

html.light .whop-status-verified {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

.whop-status-pending {
    background: rgba(244, 183, 62, 0.15);
    border: 1px solid rgba(244, 183, 62, 0.3);
    color: var(--dx-gold);
}

html.light .whop-status-pending {
    background: rgba(244, 183, 62, 0.1);
    border-color: rgba(244, 183, 62, 0.25);
}

.whop-status-icon {
    font-size: 16px;
    line-height: 1;
}

.whop-verify-btn {
    margin-left: 12px;
    padding: 4px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.whop-verify-btn:hover {
    background: var(--bg-elev);
    border-color: var(--dx-cyan);
    color: var(--text);
}

#linkWhopBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--dx-emerald);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg3);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 8px 0;
}

#linkWhopBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#linkWhopBtn:active:not(:disabled) {
    transform: translateY(0);
}

#linkWhopBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#linkWhopBtn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#whopSubscriptionBadge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(31, 221, 254, 0.15);
    border: 1px solid rgba(31, 221, 254, 0.3);
    border-radius: var(--radius-sm);
    color: var(--dx-cyan);
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

html.light #whopSubscriptionBadge {
    background: rgba(31, 221, 254, 0.1);
    border-color: rgba(31, 221, 254, 0.25);
}

/* Whop Modal Styles */
.whop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.whop-modal[style*="display: flex"],
.whop-modal[style*="display:flex"] {
    display: flex !important;
}

.whop-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.light .whop-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.whop-modal-content {
    position: relative;
    background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    min-width: 0;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: visible;
    padding: 32px;
    box-shadow: var(--shadow-2);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    margin: 0 auto;
    flex-shrink: 0;
}

/* Dark mode: ensure solid blue gradient background - fully opaque, no transparency */
html:not(.light) .whop-modal-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%) !important;
    background-color: #1a1a2e !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    /* Force solid background - no transparency */
    mix-blend-mode: normal !important;
    /* Ensure z-index is above overlay */
    z-index: 10001 !important;
    position: relative !important;
    /* Remove any transparency effects */
    isolation: isolate !important;
}

html.light .whop-modal-content {
    background: var(--panel-top);
    box-shadow: var(--shadow-2-light);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whop-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
}

.whop-modal-close:hover {
    background: var(--bg-elev);
    transform: rotate(90deg) scale(1.1);
    border-color: var(--dx-cyan);
}

.whop-modal-header {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.whop-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.whop-modal-header p {
    font-size: 14px;
    color: var(--text-dim);
    margin: 0;
}

#whopLinkForm,
#whopVerifyForm {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    padding: 0;
    margin: 0;
}

.whop-form-group {
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent any child overflow */
}

.whop-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.whop-form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: inherit;
}

.whop-form-group input:focus {
    outline: none;
    border-color: var(--dx-cyan);
    background: var(--bg-elev);
    box-shadow: 0 0 0 3px rgba(31, 221, 254, 0.1);
}

.whop-form-group input:focus-visible {
    outline: 2px solid var(--dx-cyan);
    outline-offset: 2px;
}

.whop-form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.whop-form-group input[readonly] {
    background: var(--bg-elev);
    border-color: var(--dx-cyan);
    border-width: 2px;
    font-weight: 500;
    color: var(--text);
    cursor: default;
}

html.light .whop-form-group input[readonly] {
    background: var(--surface);
    border-color: var(--dx-cyan);
}

.whop-form-group small {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.whop-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.whop-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.whop-btn-primary {
    background: var(--dx-emerald);
    color: var(--bg3);
}

.whop-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.whop-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.whop-btn-primary:focus-visible {
    outline: 2px solid var(--dx-cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(31, 221, 254, 0.2);
}

.whop-btn-secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
}

.whop-btn-secondary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    background: var(--bg-elev);
    border-color: var(--dx-cyan);
}

html.light .whop-btn-secondary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.whop-btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.whop-btn-secondary:focus-visible {
    outline: 2px solid var(--dx-cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(31, 221, 254, 0.2);
}

.whop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.whop-verification-code-container {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin: 16px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent any overflow from container */
}

.whop-verification-code {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
    padding: 12px 16px;
    background: var(--surface, #1a1a1a);
    border: 1px solid var(--line, #333);
    border-radius: var(--radius-sm, 8px);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--dx-cyan, #1fd5fe);
    letter-spacing: 1px;
    text-align: center;
    box-sizing: border-box;
    /* Fix mobile overflow - more aggressive */
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
    overflow: visible; /* Allow text to wrap, don't hide it */
    /* Prevent text selection issues on mobile */
    -webkit-user-select: text;
    user-select: text;
    /* Force text to wrap */
    white-space: normal !important;
    max-width: 100%;
    /* Ensure text wraps on all devices */
    display: block;
}

/* Responsive font size for mobile */
@media (max-width: 480px) {
    .whop-modal-content {
        max-width: calc(100vw - 16px) !important;
        margin: 16px 8px !important;
        padding: 20px 16px !important;
    }
    
    .whop-verification-code {
        font-size: 11px !important;
        padding: 8px 10px !important;
        letter-spacing: 0.3px !important;
        line-height: 1.5 !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    .whop-verification-code-container {
        flex-direction: column !important;
        gap: 8px !important;
        margin: 12px 0 !important;
    }
    
    .whop-copy-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 16px !important;
    }
}

html.light .whop-verification-code {
    background: var(--bg-elev);
    border-color: var(--line);
}

/* Copy Button */
.whop-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--dx-cyan, #1fd5fe);
    color: var(--bg, #0a0a0a);
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.whop-copy-btn:hover {
    background: var(--dx-cyan-hover, #1fb8d4);
    transform: translateY(-1px);
}

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

.whop-copy-btn-copied {
    background: #10b981 !important;
}

.whop-copy-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.whop-copy-btn-text {
    display: inline-block;
}

/* Hide copy button text on very small screens, show only icon */
@media (max-width: 360px) {
    .whop-copy-btn-text {
        display: none;
    }
    .whop-copy-btn {
        padding: 12px;
        min-width: 44px; /* Touch target size */
    }
}

/* Warning Box */
.whop-warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(244, 183, 62, 0.15);
    border: 1px solid rgba(244, 183, 62, 0.3);
    border-radius: var(--radius-sm);
    margin: 20px 0;
    align-items: flex-start;
}

html.light .whop-warning-box {
    background: rgba(244, 183, 62, 0.1);
    border-color: rgba(244, 183, 62, 0.25);
}

.whop-warning-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.whop-warning-content {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.whop-warning-content strong {
    color: var(--dx-gold);
    font-weight: 600;
}

html.light .whop-warning-content strong {
    color: #d97706;
}

/* Checkbox Label */
.whop-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    user-select: none;
}

.whop-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--dx-cyan);
    flex-shrink: 0;
    margin-top: 2px;
}

.whop-checkbox-label input[type="checkbox"]:focus {
    outline: 2px solid var(--dx-cyan);
    outline-offset: 2px;
}

.whop-checkbox-label span {
    flex: 1;
}

.whop-checkbox-label:has(input:checked) {
    color: var(--text);
}

.whop-checkbox-label:has(input:not(:checked)) {
    opacity: 0.8;
}
