/* =========================================
   ساختار کلی و ستون‌ها
   ========================================= */
.dr-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 40px 0;
    align-items: flex-start;
    font-family: inherit;
}

/* استایل ستون تقویم */
.dr-calendar-column {
    flex: 0 0 300px;
    background: #ffffff;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.03);
}

.dr-calendar-column .datepicker-plot-area {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    background: transparent;
}

/* استایل ستون متن بازتاب */
.dr-message-column {
    flex: 1;
    min-width: 300px;
}

/* =========================================
   کارت نمایش پیام
   ========================================= */
.dr-message-card {
    background: linear-gradient(145deg, #ffffff, #f9fbfd);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    transition: opacity 0.3s ease;
    min-height: 280px;
}

.dr-date-badge {
    position: absolute;
    top: -15px;
    right: 35px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.3);
}

.dr-title {
    font-size: 24px;
    color: #2c3338;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 800;
    border-bottom: 2px dashed #e2e4e7;
    padding-bottom: 15px;
}

.dr-body {
    font-size: 16px;
    line-height: 1.8;
    color: #50575e;
    text-align: justify;
}

.dr-body p {
    margin-bottom: 15px;
}

/* =========================================
   انیمیشن لودینگ چرخشی (نسخه جدید)
   ========================================= */
.dr-loading-wrap {
    text-align: center;
    padding: 40px 0;
    color: #777;
    font-size: 15px;
    font-weight: bold;
}

.dr-spinner {
    display: inline-block;
    width: 35px;
    height: 35px;
    border: 3px solid rgba(0, 115, 170, 0.1); /* هاله کم‌رنگ آبی */
    border-top: 3px solid #0073aa; /* رنگ اصلی لودینگ */
    border-radius: 50%;
    animation: dr-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes dr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   محدودیت ارتفاع متن و دکمه ادامه نوشته
   ========================================= */
.dr-text-container {
    max-height: 85px; /* <--- از 200 به 85 پیکسل کاهش یافت تا متن کمتری نشان دهد */
    overflow: hidden;
    position: relative;
    transition: max-height 0.6s ease;
}

.dr-text-container.dr-expanded {
    max-height: 2500px; /* ارتفاع دلخواه برای حالت باز */
}

.dr-text-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px; /* <--- متناسب با ارتفاع جدید کمتر شد */
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)); 
    transition: opacity 0.4s;
}

.dr-expanded .dr-text-fade {
    opacity: 0;
    pointer-events: none;
}

.dr-readmore-btn {
    display: block;
    margin: 25px auto 0;
    padding: 8px 25px;
    background: #f0f6fc;
    border: 1px solid #cce3f0;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    color: #0073aa;
    transition: all 0.3s ease;
}

.dr-readmore-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.2); /* افکت سایه جذاب موقع هاور */
}

/* =========================================
   افکت‌های جدید (ورود نرم متن و تپش تقویم)
   ========================================= */

/* ۱. انیمیشن ورود نرم متن (Slide Up) */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#dr-text-container {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ۲. انیمیشن تپش (Pulse) برای روز جاری در تقویم */
@keyframes dr-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 115, 170, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 115, 170, 0);
    }
}

/* اعمال تپش و رنگ آبی به روز جاری تقویم */
.dr-calendar-column .datepicker-plot-area .datepicker-day-view .table-days td.today span {
    background-color: #0073aa !important;
    color: #ffffff !important;
    border-radius: 50% !important; /* گرد کردن پس‌زمینه */
    animation: dr-pulse 1.5s infinite !important;
}

/* =========================================
   واکنش‌گرایی پیشرفته برای موبایل (تقویم در بالا)
   ========================================= */
@media (max-width: 768px) {
    .dr-wrapper {
        flex-direction: column; /* چینش ستونی عادی (تقویم در بالا، پیام در پایین) */
        gap: 20px;
        margin: 20px 0;
    }

    .dr-calendar-column {
        flex: 1 1 100%;
        width: 100%;
        margin-bottom: 20px; /* ایجاد فاصله مناسب با کارت پیام در پایین */
        display: flex;
        justify-content: center; 
    }
    
    /* بزرگتر کردن خانه‌های تقویم برای لمس راحت‌تر با انگشت */
    .dr-calendar-column .datepicker-plot-area {
        font-size: 16px; 
    }

    .dr-message-column {
        width: 100%;
        min-width: 100%;
    }

    .dr-message-card {
        padding: 40px 20px 25px 20px; /* تنظیم پدینگ برای جا شدن نشان تاریخ */
        min-height: auto;
    }

    .dr-date-badge {
        /* وسط چین کردن نشان تاریخ (بج تاریخ) در موبایل */
        top: -15px;
        right: 50%;
        transform: translateX(50%);
        white-space: nowrap;
    }

    .dr-title {
        font-size: 20px;
        text-align: center; /* وسط‌چین کردن عنوان پیام در موبایل */
    }

    .dr-body {
        font-size: 15px; /* فونت کمی کوچکتر و خواناتر برای موبایل */
    }
    
    .dr-readmore-btn {
        width: 80%; /* دکمه عریض‌تر برای کلیک راحت‌تر در صفحات لمسی */
        padding: 12px 20px;
    }
}
