/**
 * Raya VIP Subscription - frontend styles
 * (کارت وضعیت اشتراک + باکس قفل محتوای ویژه)
 */

@font-face {
    font-family: 'vazirX';
    src: url('/wp-content/themes/RayawpBeta-child/fonts/Vazirmatn-RDwght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================
   Box-sizing (جلوگیری از سرریز دکمه‌های تمام‌عرض)
   ========================================== */
.raya-modern-wrapper, .raya-modern-wrapper *, .rvip, .rvip * { box-sizing: border-box; }

/* ==========================================
   کارت وضعیت اشتراک (شورت‌کد user-vip-which)
   ========================================== */
.raya-modern-wrapper { font-family: 'vazirX', sans-serif !important; direction: rtl; max-width: 460px; margin: 30px auto; color: #1a1a1a; }
.raya-modern-wrapper * { font-family: 'vazirX', sans-serif !important; }

.dark-theme .raya-modern-wrapper, body.dark-mode .raya-modern-wrapper { color: #f1f5f9; }

.raya-vip-card {
    background: #ffffff;
    border: 1px solid #f5ecc9;
    border-radius: 24px;
    padding: 24px 26px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px -15px rgba(217,164,6,0.15);
}
.dark-theme .raya-vip-card, body.dark-mode .raya-vip-card { background: #1c1710; border-color: #3a2f14; }

/* === هدر: آیکون مدال + عنوان + بج‌ها === */
.raya-card-header-row {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.raya-title-col .raya-badge--days {
    border-width: 0px !important;
}

.raya-vip-card--silver .raya-features-section .raya-features-toggle,
.raya-vip-card--gold .raya-features-section .raya-features-toggle {
    background-color: transparent !important;
    border-width: 0px !important;
}

.raya-modern-wrapper .raya-vip-card--silver .raya-action-btn,
.raya-modern-wrapper .raya-vip-card--gold .raya-action-btn {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.raya-modern-wrapper .raya-vip-card--silver .raya-date-pill,
.raya-modern-wrapper .raya-vip-card--gold .raya-date-pill {
    background-color: transparent !important;
}

.raya-modern-wrapper .raya-vip-card--silver .raya-upgrade-offer,
.raya-modern-wrapper .raya-vip-card--gold .raya-upgrade-offer {
    background-image: none !important;
}

.raya-vip-card--silver .raya-secondary-btn svg,
.raya-vip-card--gold .raya-secondary-btn svg {
    color: #ffffff !important;
}

.raya-vip-card--silver .raya-secondary-btn span,
.raya-vip-card--gold .raya-secondary-btn span {
    color: #ffffff !important;
}

.raya-modern-wrapper .raya-vip-card--silver .raya-secondary-btn,
.raya-modern-wrapper .raya-vip-card--gold .raya-secondary-btn {
    background-color: #020202 !important;
    color: #ffffff !important;
    border-width: 0px !important;
}

.raya-features-section .raya-features-toggle span {
    color: #7f8c8d !important;
}
.raya-icon-box {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #1a1a1a;
    background: linear-gradient(135deg, #ffd93b, #f5b700);
    box-shadow: 0 8px 24px -4px rgba(217,164,6,0.35), 0 0 0 1px #fbeec2;
    position: relative;
}
.raya-icon-box::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(245,197,24,0.35);
    animation: raya-icon-ring-rotate 20s linear infinite;
    pointer-events: none;
}
@keyframes raya-icon-ring-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.raya-icon-box svg { width: 28px; height: 28px; stroke-width: 2.2; }
.raya-icon-box--none { color: #78716c; background: linear-gradient(135deg, #f5f5f4, #e7e5e4); box-shadow: 0 8px 20px -4px rgba(0,0,0,0.08), 0 0 0 1px #eee; }
.raya-icon-box--none::after { border-color: rgba(168,162,158,0.25); }
.raya-icon-box--silver { color: #475569; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); box-shadow: 0 8px 24px -4px rgba(100,116,139,0.25), 0 0 0 1px #e2e8f0; }
.raya-icon-box--silver::after { border-color: rgba(148,163,184,0.35); }
.raya-icon-box--gold { color: #1a1a1a; background: linear-gradient(135deg, #ffd93b, #f5b700); box-shadow: 0 8px 24px -4px rgba(245,183,0,0.4), 0 0 0 1px #fbeec2; }

.dark-theme .raya-icon-box, body.dark-mode .raya-icon-box { background: #262019; box-shadow: 0 8px 20px -4px rgba(0,0,0,0.4), 0 0 0 1px #3a2f14; }

.raya-title-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.raya-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}
.raya-card-title--none { color: #78716c; }
.dark-theme .raya-card-title, body.dark-mode .raya-card-title { color: #f5f5f4; }

/* === ردیف بج‌ها === */
.raya-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.raya-badge {
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-weight: 700;
    line-height: 1.5;
}
.raya-badge--active {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.raya-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: raya-badge-pulse 2s infinite;
}
@keyframes raya-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}
.raya-badge--days {
    color: #57534e;
    background: #f5f5f4;
    border: 1px solid #e7e5e4;
}
.raya-badge--days svg { color: #a8a29e; }

.raya-card-text {
    font-size: 0.95rem;
    color: #57534e;
    line-height: 1.9;
    margin: 0 0 16px 0;
    font-weight: 400;
    text-align: center;
}
.dark-theme .raya-card-text, body.dark-mode .raya-card-text { color: #a8a29e; }
.raya-card-text .raya-highlight-text { color: #f0b100 !important; font-weight: 800 !important; }

.raya-date-pill {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #fdf9ec; border: 1px solid #f5ecc9; border-radius: 12px;
    padding: 10px 14px; margin-bottom: 12px; font-size: 0.85rem; color: #57534e;
}
.raya-date-pill svg { color: #f0b100; }
.raya-date-pill b { color: #1a1a1a; font-weight: 800; }
.dark-theme .raya-date-pill, body.dark-mode .raya-date-pill { background: #221b0e; border-color: #3a2f14; color: #d6d3d1; }
.dark-theme .raya-date-pill b, body.dark-mode .raya-date-pill b { color: #fff; }

.raya-new-week-pill {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #fdfaf0; border: 1px solid #f5ecc9; border-radius: 12px;
    padding: 10px 14px; margin-bottom: 10px; font-size: 0.85rem; color: #57534e;
}
.raya-new-week-pill b { color: #1a1a1a; font-weight: 800; }
.raya-new-week-pill svg { color: #f0b100; flex-shrink: 0; }
.dark-theme .raya-new-week-pill, body.dark-mode .raya-new-week-pill { background: #221b0e; border-color: #3a2f14; color: #d6d3d1; }
.dark-theme .raya-new-week-pill b, body.dark-mode .raya-new-week-pill b { color: #fff; }

/* === بخش امکانات === */
.raya-features-section { margin-bottom: 14px; }

.raya-features-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #78716c;
    margin: 0 0 10px 0;
    text-align: right;
    padding-right: 2px;
}

.raya-features-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #f5ecc9;
    border-radius: 12px;
    overflow: hidden;
    background: #fdfaf0;
}
.dark-theme .raya-features-list, body.dark-mode .raya-features-list { border-color: #3a2f14; background: #221b0e; }

.raya-feature-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    padding: 9px 14px;
    border-bottom: 1px solid #f5ecc9;
    transition: background 0.15s;
}
.dark-theme .raya-feature-item, body.dark-mode .raya-feature-item { border-color: #3a2f14; }
.raya-feature-item:last-child { border-bottom: none; }
.raya-feature-item .raya-feat-text { color: #44403c; font-weight: 500; }
.dark-theme .raya-feature-item .raya-feat-text, body.dark-mode .raya-feature-item .raya-feat-text { color: #d6d3d1; }

.raya-check-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.raya-check-icon svg {
    color: #22c55e !important;
    width: 18px;
    height: 18px;
    stroke-width: 2.5px;
}
.dark-theme .raya-check-icon svg, body.dark-mode .raya-check-icon svg { color: #4ade80 !important; }
.raya-feature-item.check-highlighted .raya-check-icon svg { color: #f0b100 !important; }

/* === دکمه باز/بسته کردن امکانات === */
.raya-features-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #f5ecc9;
    border-top: none;
    background: #fdfaf0;
    color: #78716c;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0 0 12px 12px;
}
.raya-features-toggle:hover { background: #fdf3d4; color: #44403c; }
.dark-theme .raya-features-toggle, body.dark-mode .raya-features-toggle { background: #221b0e; border-color: #3a2f14; color: #a8a29e; }
.raya-chevron { transition: transform 0.3s ease; color: #f0b100; }
.raya-chevron.rotated { transform: rotate(180deg); }

/* === دکمه‌ها === */
.raya-action-btn {
    width: 100%; padding: 14px 24px; border-radius: 25px; border: none;
    text-decoration: none !important; display: flex; flex-direction: row-reverse; justify-content: center; align-items: center; gap: 10px;
    font-size: 1rem; cursor: pointer; font-weight: 800; transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffd93b, #f5b700) !important;
    box-shadow: 0 10px 25px -6px rgba(240,177,0,0.55);
    color: #1a1a1a !important;
}
.raya-action-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -6px rgba(240,177,0,0.6); }
.raya-arrow-icon { transform: rotate(180deg); }

.raya-secondary-btn {
    width: 100%; padding: 11px; border-radius: 12px; border: 1px dashed #e7c65a;
    background: #fdfaf0; color: #78716c; font-size: 0.85rem; font-weight: 700;
    text-decoration: none !important; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s ease; margin-bottom: 10px;
}
.dark-theme .raya-secondary-btn, body.dark-mode .raya-secondary-btn { border-color: #55450f; color: #d6d3d1; background: #221b0e; }
.raya-secondary-btn:hover { background: #fdf3d4; color: #1a1a1a; }
.raya-secondary-btn svg { color: #f0b100; }

/* === پیشنهاد ارتقا === */
.raya-upgrade-offer {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(245,197,24,0.12), rgba(245,183,0,0.06));
    border: 1px dashed #f0b100;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
}
.dark-theme .raya-upgrade-offer, body.dark-mode .raya-upgrade-offer { background: rgba(245,197,24,0.08); border-color: rgba(245,197,24,0.4); }
.raya-upgrade-offer-icon {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
    background: linear-gradient(135deg, #ffd93b, #f5b700); color: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
}
.raya-upgrade-offer-icon svg { width: 20px; height: 20px; }
.raya-upgrade-offer-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.raya-upgrade-offer-text strong { font-size: 0.95rem; color: #b45309; }
.dark-theme .raya-upgrade-offer-text strong, body.dark-mode .raya-upgrade-offer-text strong { color: #fbbf24; }
.raya-upgrade-offer-text span { font-size: 0.8rem; color: #78716c; font-weight: 400; }
.dark-theme .raya-upgrade-offer-text span, body.dark-mode .raya-upgrade-offer-text span { color: #d6d3d1; }
.raya-upgrade-offer-btn {
    flex-shrink: 0; background: linear-gradient(135deg, #ffd93b, #f5b700); color: #1a1a1a !important;
    text-decoration: none !important; font-size: 0.8rem; font-weight: 800; padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}

/* === ریسپانسیو === */
@media (max-width: 480px) {
    .raya-vip-card { padding: 20px; }
    .raya-card-title { font-size: 1.2rem; }
    .raya-upgrade-offer { flex-wrap: wrap; }
    .raya-icon-box { width: 50px; height: 50px; }
    .raya-icon-box svg { width: 24px; height: 24px; }
}

/* === بهبودهای ریسپانسیو و دسترسی‌پذیری === */
.raya-features-list.is-collapsed .raya-feature-item:nth-child(n+3) { display: none; }
.raya-modern-wrapper { width: 100%; }
.raya-date-pill { flex-wrap: wrap; text-align: center; }
.raya-feat-text { min-width: 0; overflow-wrap: anywhere; }
.raya-features-toggle:focus-visible,
.raya-action-btn:focus-visible,
.raya-secondary-btn:focus-visible,
.raya-upgrade-offer-btn:focus-visible { outline: 2px solid #f0b100; outline-offset: 2px; }

@media (max-width: 480px) {
    .raya-modern-wrapper { margin: 20px auto; }
    .raya-card-header-row { gap: 10px; }
    .raya-badges-row { gap: 6px; }
    .raya-upgrade-offer-text { min-width: 0; flex-basis: calc(100% - 60px); }
    .raya-upgrade-offer-btn { width: 100%; text-align: center; padding: 10px 14px; }
    .raya-action-btn { padding: 13px 18px; }
}

@media (max-width: 360px) {
    .raya-vip-card { padding: 16px; border-radius: 20px; }
    .raya-card-title { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .raya-icon-box::after, .raya-badge-dot { animation: none; }
    .raya-action-btn, .raya-chevron, .rvip__btn, .rvip__btn svg { transition: none; }
}

/* ==========================================
   باکس قفل محتوای ویژه (.rvip)
   ========================================== */
.rvip {
    --rvip-bg: #ffffff;
    --rvip-border: #f0f0f0;
    --rvip-text: #2b2b2b;
    --rvip-muted: #858585;
    --rvip-accent: #3b82f6; 
    --rvip-accent-ink: #ffffff;  
    --rvip-accent-soft: #eff6ff; 
    --rvip-radius: 18px;

    direction: rtl; 
    background: var(--rvip-bg);
    border: 1px solid var(--rvip-border); 
    border-radius: var(--rvip-radius);
    max-width: 100%; 
    box-sizing: border-box;
    margin: 25px 0; 
    padding: 22px 24px; 
    overflow: hidden;
    font-family: "vazirX", sans-serif !important; 
    contain: layout style;
}

.rvip * { font-family: "vazirX", sans-serif !important; }

.rvip.rvip--vip { --rvip-accent: #f28542; --rvip-accent-soft: #fef6f2; }
.rvip.rvip--gold { --rvip-accent: #f59e0b; --rvip-accent-soft: #fffbeb; }

.dark-theme .rvip {
    --rvip-bg: #101216; 
    --rvip-border: #272a32; 
    --rvip-text: #f4f5f7;
    --rvip-muted: #9aa1b2; 
    --rvip-accent: #60a5fa; 
    --rvip-accent-ink: #0f172a;
    --rvip-accent-soft: #1e3a8a; 
}
.dark-theme .rvip.rvip--vip { --rvip-accent: #f4995c; --rvip-accent-soft: #2c1d12; }
.dark-theme .rvip.rvip--gold { --rvip-accent: #fbbf24; --rvip-accent-soft: #452e04; }

.rvip__head {
    display: flex; align-items: center; gap: 14px; padding-bottom: 18px;
    border-bottom: 1px dashed var(--rvip-border);
}

.rvip__icon {
    width: 48px; height: 48px; border-radius: 13px; 
    background: var(--rvip-accent); color: var(--rvip-accent-ink);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.rvip__headtext { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.rvip__title { font-size: 16.5px; font-weight: 800; color: var(--rvip-text); line-height: 1.35; }
.rvip__meta { font-size: 12px; color: var(--rvip-muted); font-weight: 500; }

.rvip__body { padding-top: 18px; display: flex; flex-direction: column; gap: 18px; }

.rvip__desc {
    font-size: 14.5px; line-height: 1.8; color: var(--rvip-muted); margin: 0 !important;
}
.rvip__desc b { color: var(--rvip-text); font-weight: 800; }

.rvip__footer {
    display: flex; justify-content: flex-end; width: 100%;
}

.rvip__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent; border: 1px solid var(--rvip-border);
    color: var(--rvip-muted); font-size: 13.5px; font-weight: 600;
    padding: 10px 18px; border-radius: 10px; text-decoration: none !important;
    transition: all 0.25s ease; cursor: pointer; box-shadow: none !important;
}

.rvip__btn:hover {
    border-color: var(--rvip-accent); 
    color: var(--rvip-accent); 
    background: var(--rvip-accent-soft);
}

.rvip__btn svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.rvip__btn:hover svg { transform: translateX(-4px); }

@media (max-width: 767px) {
    .rvip { padding: 18px 16px; border-radius: 16px; }
    .rvip__icon { width: 44px; height: 44px; border-radius: 12px; }
    .rvip__icon svg { width: 20px; height: 20px; }
    .rvip__title { font-size: 15px; }
    .rvip__desc { font-size: 13.5px; text-align: justify; }
    .rvip__footer { justify-content: center; }
    .rvip__btn { width: 100%; }
}
