/**
 * Mindzi Behavioral Discounter (Pro AI Edition) - UI/UX Styling
 * Responsive 3D Ticket, FOMO Timer, and Cyberpunk Modal Integration
 */

/* ========================================================
   1. Modal Wrapper & Glassmorphism Overlay
   ======================================================== */
/* حذف کامل فونت‌های پیش‌فرض و اجبار به ارث‌بری از بادی قالب */
.mindzi-modal-wrapper, 
.mindzi-narrative-box, 
.ticket, 
.ticket *, 
.mindzi-countdown-box {
    font-family: inherit !important;
}

/* اصلاح اتیکت VIP در صفحه محصول */
.mindzi-vip-tag {
    background: #ff003c;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 10px;
    font-weight: bold;
    font-family: inherit !important;
}
.mindzi-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit !important;
    /* جلوگیری از اسکرول صفحه هنگام باز بودن پاپ‌آپ */
    overflow: hidden; 
}

.mindzi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85); /* تاریکی سایبری */
    backdrop-filter: blur(12px); /* افکت شیشه‌ای (Glassmorphism) */
    -webkit-backdrop-filter: blur(12px);
}

.mindzi-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* انیمیشن ورود فنری و جذاب */
    animation: mindziModalEnter 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* کلاس خروج نرم پاپ‌آپ (هنگام اتمام تایمر 5 ثانیه) */
.mindzi-modal-wrapper.mindzi-fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

@keyframes mindziModalEnter {
    from { opacity: 0; transform: scale(0.8) translateY(40px) rotateX(-15deg); }
    to { opacity: 1; transform: scale(1) translateY(0) rotateX(0); }
}

/* ========================================================
   2. Narrative Box (روایت داستانی تحسین کاربر)
   ======================================================== */
.mindzi-narrative-box {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-right: 4px solid #00f0ff;
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    max-width: 450px;
    text-align: right;
    direction: rtl;
    color: #e2e8f0;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    line-height: 1.7;
    font-size: 14px;
    font-weight: 500;
}

.mindzi-narrative-box p {
    margin: 0;
}

/* ========================================================
   3. 5-Second Auto-Apply Countdown (نوار پیشرفت)
   ======================================================== */
.mindzi-countdown-box {
    margin-top: 25px;
    text-align: center;
    color: #94a3b8;
    direction: rtl;
    width: 100%;
    max-width: 350px;
}

.mindzi-progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.mindzi-progress-bar {
    width: 0%;
    height: 100%;
    background: #00f0ff; /* رنگ نئون متناسب با تم AI */
    box-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff;
    /* انیمیشن 5 ثانیه‌ای کاملاً خطی برای پر شدن نوار */
    transition: width 8s linear; 
}

.mindzi-countdown-box p {
    margin: 0;
    font-size: 13px;
}

#mindzi-sec-left {
    color: #00f0ff;
    font-weight: 900;
    font-size: 18px;
}

/* ========================================================
   4. 3D Ticket Core Styles (Adapted from your provided CSS)
   ======================================================== */
.ticket-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
}

.ticket-wrapper {
    /* تغییر رنگ تم بلیت به Cyan (المان‌های هوش مصنوعی) به جای بنفش */
    --t-bg: #1e1e24;
    --t-bg-light: #2b2b36;
    --t-accent: #00f0ff; 
    --t-accent-glow: rgba(0, 240, 255, 0.5);
    --t-text-main: #f8fafc;
    --t-text-muted: #94a3b8;
    
    font-size: 15px; /* سایز پایه برای دسکتاپ */
    perspective: 1000px;
    display: inline-block;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

/* افکت شناور سه‌بعدی نرم برای جذابیت بلیت */
.ticket-wrapper:hover .ticket {
    transform: rotateX(5deg) rotateY(-5deg) scale(1.02);
}

.ticket {
    position: relative;
    width: 22em;
    color: var(--t-text-main);
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ساختار بالا و پایین بلیت (بدون تغییر در منطق، فقط بهینه‌سازی رنگ) */
.t-main {
    padding: 2em;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at bottom left, transparent 1em, var(--t-bg) 1.05em), 
                radial-gradient(circle at bottom right, transparent 1em, var(--t-bg) 1.05em);
    background-size: 51% 100%;
    background-position: bottom left, bottom right;
    background-repeat: no-repeat;
    border-top-left-radius: 1em;
    border-top-right-radius: 1em;
}

.t-content { position: relative; z-index: 1; }
.t-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2em; }
.t-logo { display: flex; align-items: center; gap: 0.5em; font-weight: 900; font-size: 1.2em; color: #fff; letter-spacing: 2px;}
.t-logo svg { width: 1.5em; height: 1.5em; fill: var(--t-accent); filter: drop-shadow(0 0 5px var(--t-accent)); animation: mindzi-logo-pulse 3s ease-in-out infinite alternate; }

@keyframes mindzi-logo-pulse {
    0% { filter: drop-shadow(0 0 2px var(--t-accent)); }
    100% { filter: drop-shadow(0 0 12px var(--t-accent)) brightness(1.3); }
}

.t-type { font-size: 0.6em; text-transform: uppercase; color: var(--t-accent); border: 1px solid var(--t-accent); padding: 0.4em 0.8em; border-radius: 99em; font-weight: 700; }
.t-title { font-size: 2.2em; font-weight: 900; line-height: 1.2; margin-bottom: 0.2em; background: linear-gradient(135deg, #fff 0%, #00f0ff 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.t-subtitle { color: var(--t-text-muted); font-size: 0.85em; margin-bottom: 2.5em; }

/* راست‌چین کردن محتوای ردیف‌ها */
.t-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5em; margin-bottom: 1em; text-align: right; }
.t-detail-item { display: flex; flex-direction: column; gap: 0.3em; }
.t-label { font-size: 0.65em; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: 0.5px;}
.t-value { font-size: 1.1em; font-weight: 700; color: var(--t-text-main); }

.t-perforation { display: flex; justify-content: space-between; height: 1em; align-items: center; position: relative; z-index: 2; }
.t-perf-line { flex-grow: 1; height: 0; border-top: 2px dashed rgba(255, 255, 255, 0.2); margin: 0 1.5em; }

.t-stub {
    padding: 2em;
    background: radial-gradient(circle at top left, transparent 1em, var(--t-bg-light) 1.05em), 
                radial-gradient(circle at top right, transparent 1em, var(--t-bg-light) 1.05em);
    background-size: 51% 100%;
    background-position: top left, top right;
    background-repeat: no-repeat;
    border-bottom-left-radius: 1em;
    border-bottom-right-radius: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.t-barcode-container { display: flex; flex-direction: column; gap: 0.5em; }
.t-barcode { width: 10em; height: 3em; background: repeating-linear-gradient(90deg, #fff 0, #fff 2px, transparent 2px, transparent 4px, #fff 4px, #fff 5px, transparent 5px, transparent 8px, #fff 8px, #fff 12px, transparent 12px, transparent 15px, #fff 15px, #fff 16px, transparent 16px, transparent 18px); opacity: 0.8; }
.t-barcode-id { font-size: 0.7em; color: var(--t-text-muted); letter-spacing: 0.2em; text-align: left; }

.t-admit { text-align: right; }
.t-admit-text { font-size: 0.7em; color: var(--t-text-muted); }
.t-admit-num { font-size: 2.5em; font-weight: 900; line-height: 1; color: var(--t-accent); text-shadow: 0 0 15px var(--t-accent-glow); }

/* ========================================================
   5. Mobile Responsiveness (تطبیق خودکار با اسکرین‌های کوچک)
   ======================================================== */
@media (max-width: 768px) {
    .mindzi-narrative-box {
        font-size: 13px;
        margin-left: 20px;
        margin-right: 20px;
    }
    .ticket-wrapper {
        font-size: 12px; /* کوچک کردن مقیاس بلیت بدون به هم ریختن اجزا */
    }
}

@media (max-width: 480px) {
    .ticket-wrapper {
        font-size: 10px; /* مقیاس مینیاتوری برای موبایل‌های کوچک */
    }
    .mindzi-countdown-box {
        max-width: 280px;
    }
}