/* ================================================
   UPGRADE MODAL - V3 STUNNING DESIGN
   Inspired by the Admin Panel
   ================================================ */

:root {
    --modal-bg: linear-gradient(165deg, rgba(22, 18, 15, 0.98) 0%, rgba(18, 14, 12, 0.98) 100%);
    --modal-border: rgba(242, 207, 123, 0.25);
    --modal-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.7);
    --text-primary: #E8DCC4;
    --text-secondary: #9B8B7E;
    --accent-gold: #f2cf7b;
    --accent-purple: #c084fc;
    --gradient-gold: linear-gradient(135deg, #f2cf7b 0%, #d29658 100%);
    --gradient-purple: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
}

.upgrade-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: fadeInOverlay 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

@keyframes fadeInOverlay { to { opacity: 1; } }

.upgrade-modal {
    background: var(--modal-bg);
    border-radius: 28px;
    max-width: 620px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1.5px solid var(--modal-border);
    box-shadow: var(--modal-shadow), 0 0 120px rgba(212, 165, 116, 0.08);
    position: relative;
    transform: scale(0.9) translateY(40px);
    opacity: 0;
    animation: slideUpModal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

@keyframes slideUpModal {
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.upgrade-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse at center, rgba(212, 165, 116, 0.1) 0%, transparent 60%);
    animation: ambientPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ambientPulse {
    50% { transform: translate(-10px, 10px) scale(1.05); }
}

.upgrade-modal-close {
    position: absolute;
    top: 22px;
    right: 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    z-index: 10;
    color: var(--text-secondary);
}

.upgrade-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: rotate(90deg) scale(1.1);
}

.upgrade-modal-content {
    padding: 56px 48px 48px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.upgrade-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(145deg, rgba(168, 107, 236, 0.15), rgba(168, 107, 236, 0.05));
    border: 2px solid rgba(168, 107, 236, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconGlow 3s ease-in-out infinite alternate;
}

@keyframes iconGlow {
    to { box-shadow: 0 0 30px rgba(168, 107, 236, 0.4), 0 0 60px rgba(168, 107, 236, 0.2); }
}

.upgrade-modal-icon .material-symbols-rounded {
    font-size: 40px;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(168, 107, 236, 0.5));
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
}

.upgrade-modal-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--accent-purple);
}

.upgrade-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 12px;
    line-height: 1.2;
}

.upgrade-modal-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 36px;
    line-height: 1.7;
}
.upgrade-modal-subtitle strong {
    color: var(--text-primary);
    font-weight: 700;
}

.upgrade-modal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 36px;
}

.upgrade-info-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}
.upgrade-info-box:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(212, 165, 116, 0.3);
    transform: translateY(-4px);
}

.upgrade-info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upgrade-info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.upgrade-modal-features { margin: 36px 0; }

.upgrade-modal-features-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.upgrade-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.upgrade-feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.3s ease;
}
.upgrade-feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-purple);
    transform: translateX(6px);
}

.feature-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(168, 107, 236, 0.2), rgba(168, 107, 236, 0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    font-weight: 900;
}
.feature-icon .material-symbols-rounded { 
    font-size: 20px;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.feature-icon svg { 
    width: 18px; 
    height: 18px;
    stroke: var(--accent-purple);
}

.upgrade-feature-item div {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.upgrade-feature-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.upgrade-modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.upgrade-btn-primary, .upgrade-btn-secondary {
    flex: 1;
    padding: 18px 28px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upgrade-btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 6px 20px rgba(168, 107, 236, 0.35);
}
.upgrade-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(168, 107, 236, 0.5);
}

.upgrade-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.upgrade-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.upgrade-modal-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .upgrade-modal-overlay {
        padding: 0;
        align-items: stretch;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .upgrade-modal {
        border-radius: 0;
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
        max-height: none;
        margin: 0;
        border: none;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .upgrade-modal::before {
        display: none; /* Hide ambient glow on mobile for performance */
    }
    
    .upgrade-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        z-index: 20;
    }
    
    .upgrade-modal-content {
        padding: 56px 20px 32px;
        min-height: calc(100vh - 56px);
        min-height: calc(100dvh - 56px);
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }
    
    .upgrade-modal-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
        border-radius: 14px;
        flex-shrink: 0;
    }
    
    .upgrade-modal-icon .material-symbols-rounded {
        font-size: 28px;
    }
    
    .upgrade-modal-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .upgrade-modal-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .upgrade-modal-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.5;
        max-width: 100%;
    }
    
    .upgrade-modal-info {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .upgrade-info-box {
        padding: 12px 10px;
        border-radius: 12px;
    }
    
    .upgrade-info-label {
        font-size: 0.65rem;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }
    
    .upgrade-info-value {
        font-size: 1.1rem;
    }
    
    .upgrade-modal-features {
        margin: 16px 0;
        flex: 1;
    }
    
    .upgrade-modal-features-title {
        font-size: 0.7rem;
        margin-bottom: 12px;
        letter-spacing: 1px;
    }
    
    .upgrade-features-list {
        gap: 8px;
    }
    
    .upgrade-feature-item {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 10px;
    }
    
    .upgrade-feature-item:hover {
        transform: none; /* Disable hover transform on mobile */
    }
    
    .feature-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 8px;
    }
    
    .feature-icon .material-symbols-rounded {
        font-size: 15px;
    }
    
    .feature-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .upgrade-feature-item div {
        font-size: 0.8rem;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .upgrade-modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 20px;
        flex-shrink: 0;
    }
    
    .upgrade-btn-primary,
    .upgrade-btn-secondary {
        padding: 14px 20px;
        font-size: 0.95rem;
        border-radius: 12px;
        width: 100%;
    }
    
    .upgrade-modal-footer {
        margin-top: 16px;
        font-size: 0.75rem;
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .upgrade-modal-content {
        padding: 52px 16px 24px;
    }
    
    .upgrade-modal-title {
        font-size: 1.3rem;
    }
    
    .upgrade-modal-subtitle {
        font-size: 0.85rem;
    }
    
    .upgrade-modal-info {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .upgrade-info-box {
        padding: 10px 8px;
    }
    
    .upgrade-info-value {
        font-size: 1rem;
    }
    
    .upgrade-feature-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .upgrade-feature-item div {
        font-size: 0.75rem;
    }
    
    .feature-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }
    
    .feature-icon .material-symbols-rounded {
        font-size: 13px;
    }
}
