/* ========================================
   PREMIUM MODAL - X (Twitter) Style
   ======================================== */

/* Overlay - Full Screen */
.premium-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom right, rgba(15, 23, 42, 0.79), rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.74));
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.premium-modal-overlay.active {
    display: flex;
}

/* Container */
.premium-modal-container {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Close Button (Top Left) */
.premium-close-btn {
    position: fixed;
    top: 16px;
    top: max(16px, env(safe-area-inset-top)); /* Avoid iPhone notch/status bar */
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.premium-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Scrollable Content */
.premium-scroll-content {
    padding: 70px 20px 40px;
    max-width: 600px;
    margin: 0 auto;
}

/* Logo */
.premium-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 18px;
    overflow: hidden;
}

/* Main Title */
.premium-main-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 24px 0;
    letter-spacing: -0.5px;
}

/* Plan Tabs */
.premium-tabs {
    display: flex;
    gap: 0;
    background: var(--border-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
}

.premium-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-tab.active {
    background: var(--accent-green);
    color: #fff;
}

.premium-tab:active {
    transform: scale(0.98);
}

/* Features List */
.premium-features-list {
    margin-bottom: 32px;
}

.premium-feature-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 12px;
}

.premium-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.premium-feature-icon i {
    font-size: 22px;
    color: #10b981;
}

.premium-feature-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px 0;
}

.premium-feature-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

/* Pricing Cards */
.premium-pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Single card layout */
.premium-pricing-cards:has(.premium-pricing-card:only-of-type:not([style*="display: none"])) {
    grid-template-columns: 1fr;
}

.premium-pricing-card {
    position: relative;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-pricing-card:active {
    transform: scale(0.98);
}

.premium-pricing-card.selected {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.premium-pricing-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #10b981;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.premium-pricing-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.premium-pricing-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.premium-price {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.premium-price-period {
    font-size: 14px;
    color: var(--text-tertiary);
}

.premium-pricing-monthly {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Single column for cloud card */
.premium-pricing-card[data-plan="cloud"] {
    grid-column: 1 / -1;
}

/* Subscribe Button */
.premium-subscribe-btn {
    width: 100%;
    padding: 18px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 30px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.premium-subscribe-btn:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.9);
}

/* Subscription Info */
.subscription-info {
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    text-align: center;
    margin-bottom: 16px;
}

/* Manage Subscription Button */
.btn-manage-subscription {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Terms */
.premium-terms {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
    text-align: center;
    margin: 0 0 20px 0;
    padding: 0 10px;
}

.premium-terms a {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Restore Purchase Button */
.btn-restore-purchase {
    width: 100%;
    padding: 14px;
    background: var(--bg-card);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Tablet & Desktop */
@media (min-width: 768px) {
    .premium-modal-container {
        width: 600px;
        height: auto;
        max-height: 90vh;
        border-radius: 20px;
        margin: auto;
    }

    .premium-close-btn {
        position: absolute;
    }

    .premium-scroll-content {
        padding: 60px 40px 40px;
    }

    .premium-main-title {
        font-size: 36px;
    }

    .premium-pricing-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .premium-pricing-card[data-plan="cloud"] {
        grid-column: auto;
    }
}

/* Light Theme */

body.light-theme .premium-modal-container {
    background: var(--bg-secondary);
}

body.light-theme .premium-close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

body.light-theme .premium-main-title {
    color: #1a202c;
}

body.light-theme .premium-tab {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .premium-tab.active {
    background: var(--accent-green);
    color: #000;
}

body.light-theme .premium-feature-item {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .premium-feature-content h3 {
    color: #1a202c;
}

body.light-theme .premium-feature-content p {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .premium-pricing-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .premium-pricing-label {
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .premium-price {
    color: #1a202c;
}

body.light-theme .premium-subscribe-btn {
    background: #000;
    color: #fff;
}

body.light-theme .btn-manage-subscription {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a202c;
}

body.light-theme .premium-terms {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .btn-restore-purchase {
    color: rgba(0, 0, 0, 0.5);
}
