/* =====================
   UPGRADE MODAL
   ===================== */
.upgrade-overlay {
    position: fixed; inset: 0;
    background: rgba(10,18,8,0.7);
    z-index: 500;
    display: flex; align-items: flex-end; justify-content: center;
    animation: fadeOverlay 0.2s ease;
}

.upgrade-sheet {
    width: 100%; max-width: 28rem;
    background: var(--moss);
    border-radius: 28px 28px 0 0;
    padding: 12px 28px 48px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
    text-align: center;
    position: relative; overflow: hidden;
}

.upgrade-sheet::before {
    content: ''; position: absolute; right: -24px; top: -24px;
    width: 180px; height: 180px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2' transform='rotate(40 50 70)'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2' transform='rotate(80 50 70)'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2' transform='rotate(120 50 70)'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.upgrade-sheet.open { transform: translateY(0); }

.upgrade-handle {
    width: 36px; height: 4px; border-radius: 99px;
    background: rgba(255,255,255,0.2);
    margin: 0 auto 24px;
}

.upgrade-icon { font-size: 2.8rem; margin-bottom: 12px; }

.upgrade-title {
    font-family: var(--font-title), var(--font-arabic);
    font-size: 1.4rem; font-weight: 700;
    color: var(--text); margin-bottom: 10px;
    position: relative; z-index: 1;
}

.upgrade-body {
    font-size: 0.85rem; color: var(--color-text-on-structure);
    font-style: italic; line-height: 1.6;
    margin-bottom: 28px;
    position: relative; z-index: 1;
}

.upgrade-btn-primary {
    display: block; width: 100%;
    background: var(--card); color: var(--text);
    border: none; border-radius: 10px; padding: 16px;
    font-size: 0.9rem; font-weight: 700;
    font-family: var(--font-body); cursor: pointer;
    letter-spacing: 0.04em; transition: all 0.2s;
    text-decoration: none; margin-bottom: 10px;
    position: relative; z-index: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.upgrade-btn-primary:hover { background: white; transform: translateY(-1px); }

.upgrade-btn-dismiss {
    width: 100%; background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 13px;
    font-size: 0.85rem; font-family: var(--font-body);
    color: rgba(255,255,255,0.5); cursor: pointer;
    transition: all 0.2s;
    position: relative; z-index: 1;
}

.upgrade-btn-dismiss:hover { border-color: rgba(255,255,255,0.35); color: rgba(255,255,255,0.8); }

/* =====================
   PREMIUM LESSON CARD
   ===================== */
.lesson-card.premium-locked {
    cursor: pointer;
    opacity: 0.6;
    border-style: dashed;
}

.lesson-card.premium-locked:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.premium-locked-cta {
    font-size: 0.72rem; font-family: var(--font-body);
    font-style: italic; color: var(--muted);
    margin-top: 6px; letter-spacing: 0.04em;
}

/* =====================
   UPGRADE SETTINGS ROW
   ===================== */
.upgrade-settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--card); margin-bottom: 1rem;
    transition: background 0.15s; gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.upgrade-settings-row:hover { background: rgba(61,92,46,0.04); }

/* =====================
   SETTINGS UPGRADE CARD (inline)
   ===================== */
.upgrade-full-card {
    background: var(--moss);
    border-radius: 10px;
    padding: 22px 20px 18px;
    margin-bottom: 1rem;
    margin-top: 1em;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.upgrade-full-card::before {
    content: ''; position: absolute; right: -20px; top: -20px;
    width: 130px; height: 130px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2' transform='rotate(60 50 70)'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.upgrade-full-header {
    display: flex; align-items: baseline;
    justify-content: space-between; margin-bottom: 16px;
    position: relative; z-index: 1;
}

.upgrade-full-title {
    font-family: var(--font-title);
    font-size: 1.2rem; font-weight: 700; color: var(--text);
}

.upgrade-full-price {
    font-size: 0.72rem; color: var(--color-text-on-structure);
    font-family: var(--font-body); font-style: italic;
}

.upgrade-full-features {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px; position: relative; z-index: 1;
}

.upgrade-feature-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.82rem; color: #c8ddb8;
    font-family: var(--font-body);
}

.upgrade-feature-row span { flex: 1; }

.upgrade-btn-secondary {
    width: 100%; background: none;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px; padding: 12px;
    font-size: 0.8rem; font-family: var(--font-body);
    color: rgba(255,255,255,0.55); cursor: pointer;
    transition: all 0.2s; letter-spacing: 0.03em;
    position: relative; z-index: 1;
}

.upgrade-btn-secondary:hover {
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.8);
}

/* =====================
   UPGRADE PAGE (freemium unlock screen)
   ===================== */
.upgrade-page-wrap {
    width: 100%; max-width: 360px;
    display: flex; flex-direction: column;
    align-items: center; gap: 0;
    animation: riseIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
    padding-bottom: 2rem;
}

.upgrade-page-logo {
    width: 72px; height: 72px;
    border-radius: 10px; margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    overflow: hidden; flex-shrink: 0;
}

.upgrade-page-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.upgrade-page-title {
    font-family: var(--font-title);
    font-size: 1.9rem; font-weight: 700;
    color: var(--text); letter-spacing: -0.02em;
    text-align: center; margin-bottom: 4px; line-height: 1;
}

.upgrade-page-title em { font-style: italic; color: var(--muted); }

.upgrade-page-sub {
    font-size: 0.72rem; font-style: italic;
    color: var(--muted); text-align: center; margin-bottom: 20px;
}

.upgrade-page-card {
    width: 100%;
    background: var(--moss);
    border-radius: 24px;
    padding: 24px 22px 22px;
    position: relative; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    margin-bottom: 12px;
}

.upgrade-page-card::before {
    content: '';
    position: absolute; right: -28px; bottom: -28px;
    width: 180px; height: 180px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2' transform='rotate(40 50 70)'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2' transform='rotate(80 50 70)'/%3E%3Cellipse cx='50' cy='70' rx='8' ry='30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2' transform='rotate(120 50 70)'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.upgrade-page-section-label {
    font-size: 0.72rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--color-text-on-structure);
    margin-bottom: 14px; position: relative; z-index: 1;
}

.upgrade-page-features {
    display: flex; flex-direction: column; gap: 9px;
    margin-bottom: 20px; position: relative; z-index: 1;
}

.upgrade-page-feature {
    font-size: 0.82rem; color: var(--text);
    font-family: var(--font-body);
    display: flex; align-items: center; gap: 8px;
}

.upgrade-page-buy-btn {
    display: block; width: 100%;
    background: var(--card); color: var(--text);
    border: none; border-radius: 12px; padding: 14px;
    font-size: 0.85rem; font-weight: 700;
    font-family: var(--font-body); cursor: pointer;
    letter-spacing: 0.04em; transition: all 0.2s;
    text-decoration: none; text-align: center;
    margin-bottom: 18px; position: relative; z-index: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.upgrade-page-buy-btn:hover { background: white; transform: translateY(-1px); }

.upgrade-page-divider {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; position: relative; z-index: 1;
}

.upgrade-page-divider::before,
.upgrade-page-divider::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.15);
}

.upgrade-page-divider span {
    font-size: 0.72rem; font-style: italic;
    color: rgba(168,200,150,0.6); white-space: nowrap;
    letter-spacing: 0.06em;
}

.upgrade-page-card .unlock-input { margin-bottom: 10px; position: relative; z-index: 1; }
.upgrade-page-card .unlock-btn   { position: relative; z-index: 1; }

.upgrade-page-free-btn {
    background: none; border: none; cursor: pointer;
    font-size: 0.72rem; font-style: italic;
    color: var(--muted); opacity: 0.65;
    font-family: var(--font-body);
    text-decoration: underline; padding: 8px;
    transition: opacity 0.15s;
}

.upgrade-page-free-btn:hover { opacity: 1; }
