/* ═══════════════════════════════════════════════
   Caloogy Plan / Upgrade Modal
   ═══════════════════════════════════════════════ */

.plan-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.plan-overlay.open { opacity: 1; pointer-events: all; }

.plan-modal {
    background: rgba(12,12,18,0.97);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 38px 38px 32px;
    max-width: 1100px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(22px) scale(0.97);
    transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.plan-overlay.open .plan-modal { transform: translateY(0) scale(1); }
.plan-modal::-webkit-scrollbar { width: 4px; }
.plan-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.plan-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 17px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.plan-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ── Header ── */
.plan-header { text-align: center; margin-bottom: 8px; }

.plan-title {
    font-size: 26px;                /* reduced from 30 */
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin: 0 0 6px;
}
.plan-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin: 0;
}

/* ── Billing toggle ── */
.plan-billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 24px;            /* reduced from 22/32 */
}
.plan-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}
.plan-toggle-label.active { color: #fff; }

.plan-toggle-track {
    width: 42px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}
.plan-toggle-track.annual { background: rgba(124,58,237,0.55); }
.plan-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.plan-toggle-track.annual .plan-toggle-thumb { transform: translateX(18px); }

.plan-save-badge {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Cards grid — 4 columns ── */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.plan-card {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 26px 22px 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1),
                border-color 0.22s ease,
                box-shadow 0.22s ease;
}
.plan-card:hover { transform: translateY(-5px); }

/* ── Free plan ── */
.plan-card.free {
    --pc: rgba(255,255,255,0.35);
    opacity: 0.72;
}
.plan-card.free:hover { transform: none; opacity: 0.85; }

/* ── Paid plan accent colors ── */
.plan-card.pro   { --pc: #60a5fa; }
.plan-card.max   { --pc: #a78bfa;
    border-color: rgba(167,139,250,0.22);
    background: rgba(124,58,237,0.06); }
.plan-card.ultra { --pc: #fbbf24; }

.plan-card.pro:hover   { border-color: rgba(96,165,250,0.4);  box-shadow: 0 8px 40px rgba(96,165,250,0.13); }
.plan-card.max:hover   { border-color: rgba(167,139,250,0.5); box-shadow: 0 8px 48px rgba(167,139,250,0.17); }
.plan-card.ultra:hover { border-color: rgba(251,191,36,0.4);  box-shadow: 0 8px 40px rgba(251,191,36,0.13); }

/* Popular badge */
.plan-popular-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(124,58,237,0.4);
}

.plan-card-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}
.plan-card.free .plan-card-icon { opacity: 0.4; }

.plan-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--pc);
    margin: 0 0 3px;
}
.plan-card-tagline {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin: 0 0 14px;
}

.plan-price-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 2px;
}
.plan-price {
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    line-height: 1;
}
.plan-card.free .plan-price { color: rgba(255,255,255,0.55); }
.plan-price-original {
    font-size: 14px;
    color: rgba(255,255,255,0.28);
    text-decoration: line-through;
}
.plan-period {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;            /* reduced from 24 */
}

.plan-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0 0 14px;               /* reduced from 20 */
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;               /* reduced from 28 */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;                       /* reduced from 11 */
}
.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;                /* reduced from 13 */
    color: rgba(255,255,255,0.65);
    line-height: 1.4;
}
.plan-feature-check {
    color: var(--pc);
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
    font-weight: 700;
}
.plan-feature-dim .plan-feature-check,
.plan-feature-dim { color: rgba(255,255,255,0.18) !important; }

.plan-subscribe-btn {
    width: 100%;
    padding: 10px 16px;             /* reduced from 13 */
    border-radius: 11px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.18s, transform 0.15s;
    position: relative;
    overflow: hidden;
}
.plan-subscribe-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.18s;
}
.plan-subscribe-btn:not(:disabled):hover::after { background: rgba(255,255,255,0.08); }
.plan-subscribe-btn:not(:disabled):hover { transform: scale(1.02); }
.plan-subscribe-btn:not(:disabled):active { transform: scale(0.98); }

/* Free — ghost button */
.plan-current-btn {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.4) !important;
    cursor: default !important;
    box-shadow: none !important;
}

.plan-card.pro   .plan-subscribe-btn { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.plan-card.max   .plan-subscribe-btn { background: linear-gradient(135deg, #6d28d9, #a78bfa); box-shadow: 0 3px 16px rgba(124,58,237,0.35); }
.plan-card.ultra .plan-subscribe-btn { background: linear-gradient(135deg, #b45309, #fbbf24); }

.plan-footer-note {
    text-align: center;
    margin-top: 18px;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
}

/* ── Edit Profile Modal ── */
.edit-profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.edit-profile-modal-overlay.open { opacity: 1; pointer-events: all; }
.edit-profile-modal-overlay .auth-modal {
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.edit-profile-modal-overlay.open .auth-modal { transform: translateY(0) scale(1); }

/* ── Light theme ── */
[data-theme="light"] .plan-modal,
[data-theme="system"] .plan-modal {
    background: rgba(250,250,252,0.98);
    border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .plan-title,
[data-theme="system"] .plan-title { color: #0f0f15; }
[data-theme="light"] .plan-close,
[data-theme="system"] .plan-close { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.4); }
[data-theme="light"] .plan-close:hover,
[data-theme="system"] .plan-close:hover { background: rgba(0,0,0,0.1); color: #000; }
[data-theme="light"] .plan-subtitle,
[data-theme="system"] .plan-subtitle { color: rgba(0,0,0,0.42); }
[data-theme="light"] .plan-toggle-label,
[data-theme="system"] .plan-toggle-label { color: rgba(0,0,0,0.4); }
[data-theme="light"] .plan-toggle-label.active,
[data-theme="system"] .plan-toggle-label.active { color: #000; }
[data-theme="light"] .plan-toggle-track,
[data-theme="system"] .plan-toggle-track { background: rgba(0,0,0,0.12); }
[data-theme="light"] .plan-card,
[data-theme="system"] .plan-card { background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.09); }
[data-theme="light"] .plan-card.max,
[data-theme="system"] .plan-card.max { background: rgba(124,58,237,0.04); border-color: rgba(124,58,237,0.18); }
[data-theme="light"] .plan-price,
[data-theme="system"] .plan-price { color: #0f0f15; }
[data-theme="light"] .plan-card.free .plan-price,
[data-theme="system"] .plan-card.free .plan-price { color: rgba(0,0,0,0.4); }
[data-theme="light"] .plan-features li,
[data-theme="system"] .plan-features li { color: rgba(0,0,0,0.65); }
[data-theme="light"] .plan-divider,
[data-theme="system"] .plan-divider { background: rgba(0,0,0,0.07); }
[data-theme="light"] .plan-card-tagline,
[data-theme="system"] .plan-card-tagline { color: rgba(0,0,0,0.42); }
[data-theme="light"] .plan-period,
[data-theme="system"] .plan-period { color: rgba(0,0,0,0.42); }
[data-theme="light"] .plan-price-original,
[data-theme="system"] .plan-price-original { color: rgba(0,0,0,0.28); }
[data-theme="light"] .plan-footer-note,
[data-theme="system"] .plan-footer-note { color: rgba(0,0,0,0.25); }
[data-theme="light"] .plan-current-btn,
[data-theme="system"] .plan-current-btn {
    background: rgba(0,0,0,0.07) !important;
    color: rgba(0,0,0,0.35) !important;
}
[data-theme="light"] .plan-feature-dim .plan-feature-check,
[data-theme="light"] .plan-feature-dim,
[data-theme="system"] .plan-feature-dim .plan-feature-check,
[data-theme="system"] .plan-feature-dim { color: rgba(0,0,0,0.18) !important; }

/* ── Mobile ── */
@media (max-width: 860px) {
    .plan-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .plan-modal { padding: 26px 16px 22px; border-radius: 18px; }
    .plan-title { font-size: 22px; }
    .plan-cards { grid-template-columns: 1fr; max-width: 300px; margin: 0 auto; }
    .plan-price { font-size: 28px; }
}
