/**
 * استایل‌های فرانت‌اند ایمن حساب | ردیاب تور
 * سیستم طراحی یکپارچه: سرمه‌ای × طلایی × سفید
 *
 * این فایل روی متغیرهای CSS تعریف‌شده در templates/single-tour.php سوار می‌شود
 * (رنگ‌های :root آنجا از تنظیمات ادمین می‌آیند). مقادیر پیش‌فرض زیر صرفاً
 * fallback هستند تا اگر این استایل قبل از رندر شدن قالب لود شد، چیزی نشکند.
 *
 * @package WP_Tour_Tracker_Pro
 */

/* ============================================
   فونت میخک — فایل‌ها در public/assets/fonts/ قرار دارند
   (مسیر نسبی از همین فایل CSS که در public/assets/css/ است)
   ============================================ */
@font-face {
    font-family: 'Mikhak';
    src: url('../fonts/Mikhak-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Mikhak';
    src: url('../fonts/Mikhak-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Mikhak';
    src: url('../fonts/Mikhak-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Mikhak';
    src: url('../fonts/Mikhak-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --wptt-primary: #C9A24C;
    --wptt-primary-dark: #A9822E;
    --wptt-on-primary: #211804;
    --wptt-secondary: #0B1220;
    --wptt-navy-900: #070B16;
    --wptt-navy-800: #111C34;
    --wptt-navy-700: #1B2A4A;
    --wptt-white: #FFFFFF;
    --wptt-cream: #FAF8F3;
    --wptt-ink: #171B26;
    --wptt-gray-100: #F5F2EA;
    --wptt-gray-200: #EAE3D4;
    --wptt-gray-300: #D9D0B8;
    --wptt-gray-400: #B2A98F;
    --wptt-gray-500: #8B8478;
    --wptt-gray-600: #6B6558;
    --wptt-line-dark: rgba(255,255,255,0.12);
    --wptt-shadow-sm: 0 2px 8px rgba(10,14,25,0.06);
    --wptt-shadow-md: 0 8px 28px rgba(10,14,25,0.09);
    --wptt-shadow-lg: 0 18px 48px rgba(10,14,25,0.14);
    --wptt-radius: 16px;
    --wptt-radius-sm: 10px;
    --wptt-transition: all 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* ============================================
   ردیاب زنده — پوسته تیره داخل کارت
   (مارک‌آپ داخل #trackerContent توسط tracker.js ساخته می‌شود)
   ============================================ */
.wptt-route-map {
    margin-bottom: 14px;
}

.wptt-flight-map {
    width: 100%;
    height: 400px;
    min-height: 220px;
    border-radius: var(--wptt-radius-sm);
    overflow: hidden;
    background: var(--wptt-navy-900);
    border: 1px solid var(--wptt-line-dark);
    box-shadow: var(--wptt-shadow-sm);
}

/* حالت جایگزین وقتی نمایش نقشه در تنظیمات غیرفعال است (wptt_show_map=0) */
.wptt-simple-route {
    width: 100%;
    min-height: 90px;
    border-radius: var(--wptt-radius-sm);
    background: var(--wptt-navy-900);
    border: 1px solid var(--wptt-line-dark);
    box-shadow: var(--wptt-shadow-sm);
    padding: 22px 16px;
    overflow-x: auto;
}
.wptt-simple-route-track {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    padding: 0 6px;
}
.wptt-simple-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 74px;
    opacity: 0.55;
    transition: var(--wptt-transition);
}
.wptt-simple-stop .dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--wptt-navy-800);
    border: 2px solid var(--wptt-line-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.wptt-simple-stop .name {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wptt-simple-stop.done { opacity: 0.85; }
.wptt-simple-stop.done .dot { border-color: var(--wptt-primary); background: rgba(201,162,76,0.12); }
.wptt-simple-stop.active { opacity: 1; }
.wptt-simple-stop.active .dot {
    border-color: #E53935;
    background: rgba(229,57,53,0.15);
    box-shadow: 0 0 0 5px rgba(229,57,53,0.18);
    transform: scale(1.08);
}
.wptt-simple-stop.active .name { color: #FFFFFF; }
.wptt-simple-arrow {
    font-size: 15px;
    color: rgba(255,255,255,0.25);
    margin-bottom: 20px;
    flex-shrink: 0;
}
.wptt-simple-arrow.done { color: var(--wptt-primary); }

.wptt-flight-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    background: var(--wptt-navy-800);
    border: 1px solid var(--wptt-line-dark);
    border-radius: var(--wptt-radius-sm);
    padding: 12px 18px;
    margin-top: 12px;
    color: var(--wptt-white);
    font-size: 14px;
}

.wptt-flight-info .wptt-flight-from,
.wptt-flight-info .wptt-flight-to {
    font-weight: 700;
}

.wptt-flight-info .wptt-flight-arrow {
    color: var(--wptt-primary);
    font-weight: 700;
}

.wptt-flight-info .wptt-flight-detail {
    color: var(--wptt-primary);
    font-size: 12px;
}

.wptt-flight-info .wptt-flight-progress {
    background: rgba(201,162,76,0.16);
    color: var(--wptt-primary);
    border: 1px solid rgba(201,162,76,0.3);
    padding: 3px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 12px;
}

.wptt-control-panel {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.wptt-control-btn {
    background: var(--wptt-navy-800);
    border: 1.5px solid var(--wptt-line-dark);
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: var(--wptt-white);
    cursor: pointer;
    font-family: inherit;
    transition: var(--wptt-transition);
}

.wptt-control-btn:hover {
    transform: translateY(-1px);
    border-color: var(--wptt-primary);
}

.wptt-control-btn#wpttStartBtn {
    background: linear-gradient(135deg, var(--wptt-primary), var(--wptt-primary-dark));
    border-color: var(--wptt-primary);
    color: var(--wptt-on-primary);
    box-shadow: 0 4px 16px rgba(201,162,76,0.28);
}

.wptt-control-btn#wpttPauseBtn { border-color: #E29A3C; color: #E29A3C; }
.wptt-control-btn#wpttResetBtn { border-color: #E05555; color: #E05555; }

/* ============================================
   جزئیات شهر فعلی روی نقشه (تزریق‌شده توسط JS)
   ============================================ */
.wptt-tour-details {
    background: var(--wptt-navy-800);
    border: 1px solid var(--wptt-line-dark);
    border-radius: var(--wptt-radius-sm);
    padding: 18px 20px 20px;
    margin-top: 14px;
    color: var(--wptt-white);
    /* حداقل ارتفاع ثابت تا وقتی محتوای شهر عوض می‌شود (توضیحات کوتاه/بلند، تعداد تگ‌های متفاوت)
       ارتفاع کارت ناگهانی تغییر نکند و صفحه بالا/پایین نپرد. */
    min-height: 360px;
}

.wptt-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.wptt-detail-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--wptt-primary) !important;
    margin: 0;
}

.wptt-detail-badge {
    font-size: 11.5px;
    color: var(--wptt-primary);
    background: rgba(201,162,76,0.12);
    padding: 4px 14px;
    border-radius: 50px;
    border: 1px solid rgba(201,162,76,0.25);
}

.wptt-detail-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.82);
    line-height: 1.8;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border-right: 3px solid var(--wptt-primary);
    margin-bottom: 14px;
}

.wptt-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.wptt-info-card {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 12px 14px 10px;
    border: 1px solid var(--wptt-line-dark);
}

.wptt-info-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    /* این رنگ عمداً به رنگ اصلی قالب (--wptt-primary) وصل نیست؛ متغیر مستقل خودش را دارد
       که فقط از تنظیمات (رنگ عنوان کارت‌ها) قابل تغییر است، نه از طلایی/سرمه‌ای قالب. */
    color: var(--wptt-card-header-color, #FFFFFF) !important;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--wptt-line-dark);
}

/* h4 داخل این کارت (عنوان «جاذبه‌ها»/«اقامت»/«غذاها»/«فعالیت‌ها») رنگش را باید صریحاً بگیرد،
   نه فقط با ارث‌بری از والد — چون اگر قالب/المنتور یک رنگ مستقیم روی h4 ست کند (حتی با
   اولویت پایین)، آن رنگ مستقیم روی h4 برنده می‌شود نه رنگ ارث‌بری‌شده از والد. */
.wptt-info-card-header h4 {
    color: inherit !important;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.wptt-info-card-header i {
    color: var(--wptt-primary) !important;
    background: rgba(201,162,76,0.12);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.wptt-info-tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wptt-info-tag {
    font-size: 13px;
    padding: 5px 9px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border: 1px solid var(--wptt-line-dark);
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.wptt-activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.wptt-activity-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--wptt-line-dark);
}

.wptt-activity-icon { font-size: 17px; flex-shrink: 0; }
.wptt-activity-title { font-size: 13.5px; font-weight: 600; color: #FFFFFF; }
.wptt-activity-time { font-size: 11px; color: rgba(255,255,255,0.85); }

.wptt-next-destination {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 16px;
    background: rgba(201,162,76,0.06);
    border-radius: 10px;
    border: 1px solid rgba(201,162,76,0.16);
    margin-top: 10px;
    font-size: 14px;
    color: rgba(255,255,255,0.82);
}

.wptt-next-destination strong { color: var(--wptt-white); }
.wptt-next-destination .wptt-next-arrow { color: var(--wptt-primary); font-weight: 700; }
.wptt-next-destination .wptt-countdown {
    color: var(--wptt-primary);
    font-weight: 700;
    font-size: 12px;
    margin-right: auto;
}

.wptt-next-destination.final {
    background: rgba(76,175,116,0.08);
    border-color: rgba(76,175,116,0.2);
    color: #6FCF97;
}

.wptt-next-destination.origin-leg {
    background: rgba(201,162,76,0.1);
    border-color: rgba(201,162,76,0.28);
}

.wptt-trip-complete,
.wptt-complete-stats {
    text-align: center;
}

.wptt-trip-complete {
    padding: 44px 20px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--wptt-radius-sm);
    border: 2px dashed rgba(201,162,76,0.3);
    margin-top: 14px;
    color: var(--wptt-white);
    min-height: 360px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wptt-trip-complete .wptt-complete-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.wptt-trip-complete h2 { font-size: 24px; font-weight: 800; color: var(--wptt-primary) !important; margin: 0 0 8px 0; }
.wptt-trip-complete p { font-size: 15px; color: rgba(255,255,255,0.75); margin: 0 0 18px 0; max-width: 420px; margin-inline: auto; }

.wptt-complete-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wptt-complete-stats span {
    background: rgba(255,255,255,0.05);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--wptt-primary);
    border: 1px solid var(--wptt-line-dark);
}

/* ============================================
   نشانگرهای نقشه (Leaflet divIcons)
   ============================================ */
.wptt-marker-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--wptt-navy-800);
    border: 2px solid var(--wptt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    transition: var(--wptt-transition);
}

.wptt-marker-dot.start,
.wptt-marker-dot.end {
    background: var(--wptt-primary);
    border-color: var(--wptt-white);
}

.wptt-marker-dot.completed { opacity: 0.55; }

.wptt-marker-dot.active {
    box-shadow: 0 0 0 6px rgba(201,162,76,0.25), 0 2px 10px rgba(0,0,0,0.35);
    transform: scale(1.12);
}

.wptt-marker-label {
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--wptt-white);
    background: rgba(7,11,22,0.75);
    padding: 1px 8px;
    border-radius: 6px;
    margin-top: 3px;
    white-space: nowrap;
}

.wptt-marker-date {
    text-align: center;
    font-size: 9px;
    color: var(--wptt-primary);
    margin-top: 1px;
}

.wptt-marker-origin-badge {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--wptt-primary);
}

/* در زوم پایین (وقتی مبدا خیلی دور از خوشهٔ مقصدهاست و مقصدها روی هم می‌افتند)
   فقط نقطه‌ها را نگه می‌داریم و برچسب‌های متنی را مخفی می‌کنیم تا شلوغ نشود.
   با زوم بیشتر (دکمه‌های +/- نقشه) دوباره ظاهر می‌شوند. */
.leaflet-container.wptt-zoomed-out .wptt-marker-label,
.leaflet-container.wptt-zoomed-out .wptt-marker-date,
.leaflet-container.wptt-zoomed-out .wptt-marker-origin-badge {
    display: none;
}
.leaflet-container.wptt-zoomed-out .wptt-marker-dot {
    width: 26px;
    height: 26px;
}

.wptt-plane-marker-container { position: relative; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; }
.wptt-plane-svg { position: relative; z-index: 2; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6)); transition: transform 0.15s linear; }
.wptt-plane-glow {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229,57,53,0.45), transparent 70%);
    animation: wpttPlaneGlow 1.8s ease-in-out infinite;
}
.wptt-plane-marker-container.landing .wptt-plane-glow {
    background: radial-gradient(circle, rgba(111,207,151,0.5), transparent 70%);
}
@keyframes wpttPlaneGlow {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* خط‌چین متحرک روی بخش باقیماندهٔ مسیر — حس «در حال پرواز» را روی نقشه القا می‌کند */
@keyframes wpttDashFlow {
    to { stroke-dashoffset: -24; }
}

.wptt-error { text-align: center; padding: 30px 16px; color: #E05555; font-size: 13px; }

/* ============================================
   لینک‌های خارجی (نمایش شبکه‌های اجتماعی از لیوفلت popup و غیره)
   ============================================ */
.leaflet-popup-content-wrapper {
    background: var(--wptt-navy-800);
    color: var(--wptt-white);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.leaflet-popup-tip { background: var(--wptt-navy-800); }
.leaflet-container a.leaflet-popup-close-button { color: var(--wptt-primary); }
.leaflet-control-attribution { background: rgba(7,11,22,0.75) !important; color: rgba(255,255,255,0.55) !important; }
.leaflet-control-attribution a { color: rgba(255,255,255,0.75) !important; }
.leaflet-control-zoom a { background: var(--wptt-navy-800) !important; color: var(--wptt-white) !important; border-color: var(--wptt-line-dark) !important; }
.leaflet-control-zoom a:hover { background: var(--wptt-navy-700) !important; color: var(--wptt-primary) !important; }

/* ============================================
   ریسپانسیو
   ============================================ */
@media (max-width: 768px) {
    .wptt-flight-map { height: 300px; }
    .wptt-info-grid { grid-template-columns: 1fr; }
    .wptt-activities-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .wptt-flight-map { height: 250px; }
    .wptt-activities-grid { grid-template-columns: 1fr; }
    .wptt-flight-info { font-size: 12px; padding: 10px 12px; }
}

@media print {
    .wptt-flight-map { height: 240px; }
    .wptt-control-panel { display: none; }
}
