/* متغیرهای رنگی - الگو گرفته از Time.ir و درخواست کاربر */
:root {
    --mjc-bg: transparent;
    --mjc-card-bg: #ffffff;
    --mjc-primary: #0093a3; /* آبی فیروزه‌ای تیره (رنگ اصلی سایت) */
    --mjc-primary-dark: #007682;
    --mjc-text-dark: #333333;
    --mjc-text-gray: #666666;
    --mjc-holiday: #d32f2f; /* قرمز برای روزهای تعطیل/جمعه */
    --mjc-holiday-bg: #fff5f5; /* هاله قرمز روز تعطیل */
    --mjc-custom: #1e3a8a; /* آبی تیره برای رویدادهای دستی */
    --mjc-custom-bg: #eff6ff; /* هاله آبی روز دستی */
    --mjc-border: #e8e8e8;
}

/* ساختار کلی (راست‌چین و ارث‌بری فونت) */
.mjc-wrapper {
    display: flex;
    flex-wrap: wrap-reverse; /* تقویم سمت راست، رویداد سمت چپ در حالت RTL */
    gap: 25px;
    background-color: var(--mjc-bg);
    font-family: inherit; /* سازگاری ۱۰۰٪ با فونت المنتور */
    direction: rtl;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* =========================================
   پنل رویدادها (سمت چپ)
========================================= */
.mjc-events-card {
    flex: 1.5 1 380px; /* افزایش سهم عرض پنل رویدادها (مقدار قبلی 1 1 320px بود) */
    background: var(--mjc-card-bg);
    border: 1px solid var(--mjc-border);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.mjc-events-header {
    background: #f9f9f9;
    padding: 20px;
    border-bottom: 1px solid var(--mjc-border);
    border-radius: 10px 10px 0 0;
}

.mjc-events-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--mjc-primary);
    font-family: inherit;
    font-weight: bold;
    text-align: right;
}

.mjc-events-body {
    padding: 15px;
    max-height: 480px;
    overflow-y: auto;
}

.mjc-event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mjc-event-item {
    display: flex;
    gap: 12px; /* کمی کاهش فاصله برای زیبایی بیشتر */
    padding: 10px 10px;
    border-bottom: 1px dashed #ddd;
    font-size: 12px; /* تغییر سایز فونت به ۱۲ پیکسل طبق درخواست شما */
    line-height: 1.6;
    transition: background 0.3s;
}

.mjc-event-item:last-child {
    border-bottom: none;
}

.mjc-event-item:hover {
    background: #fdfdfd;
}

.mjc-e-date {
    font-weight: bold;
    color: var(--mjc-text-dark);
    white-space: nowrap;
    min-width: 65px; /* کاهش عرض تاریخ متناسب با سایز فونت ۱۲ */
}

.mjc-e-text {
    color: var(--mjc-text-gray);
}

/* رنگ‌بندی داینامیک در لیست رویدادها */
.mjc-event-item.is-holiday .mjc-e-date,
.mjc-event-item.is-holiday .mjc-e-text {
    color: var(--mjc-holiday);
}

.mjc-event-item.is-custom .mjc-e-date,
.mjc-event-item.is-custom .mjc-e-text {
    color: var(--mjc-custom);
}

/* =========================================
   پنل تقویم (سمت راست)
========================================= */
.mjc-calendar-card {
    flex: 2 1 450px;
    background: var(--mjc-card-bg);
    border: 1px solid var(--mjc-border);
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

/* طراحی گیره‌های بالای تقویم (شبیه فنر کلاسیک) */
.mjc-cal-rings {
    position: absolute;
    top: -15px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 25%;
    box-sizing: border-box;
    z-index: 2;
}

.mjc-cal-rings .ring {
    width: 16px;
    height: 35px;
    background: linear-gradient(to bottom, #f0f0f0 0%, #a1a1a1 100%);
    border-radius: 10px;
    border: 1px solid #999;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.2), 0 3px 5px rgba(0,0,0,0.1);
}

/* هدر تقویم */
.mjc-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 20px 20px;
    border-bottom: 2px solid var(--mjc-primary); /* خط فیروزه‌ای زیر هدر */
}

.mjc-arrow-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: var(--mjc-primary);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    transition: 0.3s;
}

.mjc-arrow-btn:hover {
    background: var(--mjc-primary);
    color: white;
    border-color: var(--mjc-primary);
}

.mjc-cal-title h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--mjc-text-dark);
    font-family: inherit;
}

.mjc-gregorian-range {
    display: block;
    font-size: 0.85rem;
    color: var(--mjc-text-gray);
    margin-top: 6px;
    text-align: center;
}

/* بدنه تقویم (روزها) */
.mjc-cal-body {
    padding: 15px;
}

.mjc-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: #ffffff; /* رنگ متن سفید */
    background-color: var(--mjc-primary-dark); /* پس‌زمینه آبی تیره مشابه عکس */
    padding: 12px 0;
    border-radius: 8px; /* گوشه‌های گرد مشابه عکس */
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.mjc-weekdays div:last-child {
    color: #ffffff; /* برای اینکه در نوار آبی، کلمه جمعه هم سفید بماند */
}

.mjc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 15px;
}

/* سلول‌های روز */
.mjc-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 75px;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mjc-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.mjc-day:not(.empty):hover {
    background: #f0fbfc;
    border-color: var(--mjc-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,147,163,0.1);
}

/* روز جاری */
.mjc-day.today {
    border: 2px solid var(--mjc-primary);
    background: #e8f9fa;
}

/* استایل روزهای تعطیل (جمعه‌ها و مناسبت‌ها) - قرمز */
.mjc-day.is-holiday {
    background: var(--mjc-holiday-bg);
    border-color: #ffd6d6;
}
.mjc-day.is-holiday .mjc-d-fa {
    color: var(--mjc-holiday);
}
.mjc-day.is-holiday .mjc-d-sub {
    color: #e57373;
}

/* استایل روزهای رویداد دستی - آبی تیره */
.mjc-day.has-custom {
    background: var(--mjc-custom-bg);
    border-color: #bfdbfe;
}
.mjc-day.has-custom .mjc-d-fa {
    color: var(--mjc-custom);
}
.mjc-day.has-custom .mjc-d-sub {
    color: #60a5fa;
}

/* اعداد و فونت داخل روز */
.mjc-d-fa {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--mjc-text-dark);
    line-height: 1;
    margin-bottom: 8px;
}

.mjc-d-sub {
    display: flex;
    justify-content: space-between;
    width: 85%;
    font-size: 0.7rem;
    color: #999;
}

/* دکمه سراسری "برو به امروز" */
.mjc-today-btn {
    display: block;
    width: 100%;
    background: var(--mjc-primary);
    color: #ffffff;
    border: none;
    padding: 15px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 0 10px 10px;
    transition: background 0.3s;
    margin-top: auto;
}

.mjc-today-btn:hover {
    background: var(--mjc-primary-dark);
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .mjc-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    .mjc-events-card {
        order: 2;
    }
    .mjc-calendar-card {
        order: 1;
    }
    .mjc-day {
        height: 60px;
    }
    .mjc-d-fa {
        font-size: 1.2rem;
    }
    .mjc-d-sub {
        font-size: 0.65rem;
    }
    .mjc-cal-rings .ring {
        height: 25px;
    }
}
