/**
 * Subscription Manager Styles
 * PRO badges, upgrade modals, and tier-specific UI
 */

/* ============================================================================
   PRO BADGE
   ============================================================================ */

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    cursor: help;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pro-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.pro-badge-large {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

/* ============================================================================
   UPGRADE MODAL
   ============================================================================ */

.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.upgrade-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upgrade-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
}

.upgrade-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.upgrade-modal-content {
    padding: 2rem;
    text-align: center;
}

.upgrade-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.upgrade-modal h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.upgrade-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.upgrade-features {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.upgrade-features h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.upgrade-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upgrade-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.upgrade-features li:last-child {
    border-bottom: none;
}

.upgrade-features li::before {
    content: '✨';
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.btn-upgrade-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-upgrade-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-upgrade-primary:active {
    transform: translateY(0);
}

.btn-upgrade-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-upgrade-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* ============================================================================
   TIER STATUS DISPLAY
   ============================================================================ */

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.subscription-status.tier-free {
    color: var(--text-secondary);
}

.subscription-status.tier-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.subscription-status .tier-icon {
    font-size: 1.2rem;
}

/* ============================================================================
   FEATURE LOCKED STATE
   ============================================================================ */

.feature-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.feature-locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 50%;
}

/* ============================================================================
   WATERMARK (for free tier)
   ============================================================================ */

.antpool-watermark {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.antpool-watermark::before {
    content: 'Powered by ';
}

.antpool-watermark::after {
    content: ' AntPool';
    font-weight: 600;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .upgrade-modal {
        max-width: 95%;
    }

    .upgrade-modal-content {
        padding: 1.5rem;
    }

    .upgrade-modal h2 {
        font-size: 1.5rem;
    }

    .upgrade-icon {
        font-size: 3rem;
    }

    .upgrade-features li {
        font-size: 0.85rem;
    }
}

/* ============================================================================
   DARK THEME ADJUSTMENTS
   ============================================================================ */

[data-theme="dark"] .upgrade-modal {
    background: #1a1a2e;
}

[data-theme="dark"] .upgrade-features {
    background: #16213e;
}

[data-theme="dark"] .btn-upgrade-secondary {
    border-color: #2d3748;
}

[data-theme="dark"] .btn-upgrade-secondary:hover {
    background: #2d3748;
}

/* ============================================================================
   PRO BADGE INLINE (for buttons)
   ============================================================================ */

.pro-badge-inline {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    opacity: 0.8;
}

.pro-feature-btn {
    position: relative;
}

.pro-feature-btn:hover .pro-badge-inline {
    opacity: 1;
    transform: scale(1.1);
}

/* Game card locked state */
.game-card.game-locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.game-card.game-locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.3;
}

/* ============================================================================
   BETA LAUNCH MODAL
   ============================================================================ */

.beta-modal-content {
    background: var(--bg-primary);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    animation: betaModalIn 0.4s ease;
}

@keyframes betaModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.beta-modal-header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.beta-rocket {
    font-size: 3.5rem;
    animation: rocketBounce 1s ease infinite;
}

@keyframes rocketBounce {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(-10px) rotate(10deg); }
}

.beta-modal-header h2 {
    margin: 0.5rem 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.beta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    vertical-align: middle;
    animation: betaPulse 2s ease infinite;
}

@keyframes betaPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.beta-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.beta-modal-body {
    padding: 1.5rem 2rem;
}

.beta-announcement {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.beta-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.beta-text strong {
    display: block;
    font-size: 1rem;
    color: #10b981;
    margin-bottom: 0.25rem;
}

.beta-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.beta-features-preview h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.beta-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.beta-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.beta-feature .feature-icon {
    font-size: 1.1rem;
}

.beta-feature .feature-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.beta-feature .pro-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 3px;
}

.beta-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.beta-notice span:first-child {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.beta-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid var(--glass-border);
}

.beta-dont-show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.beta-dont-show input {
    cursor: pointer;
}

.beta-continue-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.beta-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* BETA Version Badge in Header */
.version-badge.beta-version {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    font-weight: 600;
    animation: betaGlow 2s ease infinite;
}

@keyframes betaGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
}

/* BETA PRO Button */
.upgrade-pro-btn.beta-pro-btn {
    opacity: 1 !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    position: relative;
}

.beta-mini-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 3px;
    animation: betaPulse 2s ease infinite;
}

/* ============================================================================
   SUBSCRIPTION PLANS - BETA UPDATES
   ============================================================================ */

.subscription-beta-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.subscription-beta-banner .beta-icon {
    font-size: 1.5rem;
}

.beta-banner-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.beta-banner-text strong {
    font-size: 0.9rem;
    color: #10b981;
}

.beta-banner-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.plan-features-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.plan-features-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.plan-features-list li span {
    width: 18px;
    text-align: center;
    font-weight: 700;
}

.plan-features-list .feature-included span {
    color: #10b981;
}

.plan-features-list .feature-excluded span {
    color: #ef4444;
    opacity: 0.6;
}

.plan-features-list .feature-excluded {
    opacity: 0.5;
    text-decoration: line-through;
}

.plan-features-list .highlight {
    color: var(--text-primary);
    font-weight: 500;
}

.plan-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.post-beta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.plan-footer.beta-footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.beta-free-now {
    font-size: 0.9rem;
    font-weight: 600;
    color: #10b981;
}

.post-beta-price {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.plan-badge.beta-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .beta-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .beta-modal-header {
        padding: 1.5rem 1.25rem 1rem;
    }
    
    .beta-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .beta-modal-body {
        padding: 1.25rem;
    }
    
    .beta-features-grid {
        grid-template-columns: 1fr;
    }
    
    .beta-modal-footer {
        padding: 1.25rem;
    }
    
    .subscription-beta-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Light Mode Adjustments */
[data-theme="light"] .beta-modal-content {
    background: #ffffff;
}

[data-theme="light"] .version-badge.beta-version {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
    color: #d97706;
}