/* استایل اصلی افزونه Help for Elementor */

.hfe-countdown-timer {
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    direction: ltr; /* جهت چپ به راست */
    display: block;
    width: 100%;
}

/* استایل کانتینر اصلی */
.hfe-countdown-container {
    display: flex;
    align-items: center;
    direction: ltr; /* جهت چپ به راست */
}

/* حالت افقی (پیش‌فرض) */
.hfe-direction-horizontal .hfe-countdown-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
}

/* حالت عمودی */
.hfe-direction-vertical .hfe-countdown-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* کلاس‌های تراز برای حالت افقی */
.hfe-direction-horizontal.hfe-align-flex-start .hfe-countdown-container {
    justify-content: flex-start;
}

.hfe-direction-horizontal.hfe-align-center .hfe-countdown-container {
    justify-content: center;
}

.hfe-direction-horizontal.hfe-align-flex-end .hfe-countdown-container {
    justify-content: flex-end;
}

/* کلاس‌های تراز برای حالت عمودی */
.hfe-direction-vertical .hfe-countdown-container {
    justify-content: center;
}

/* تراز عمودی آیتم‌ها */
.hfe-direction-vertical.hfe-align-flex-start .hfe-countdown-container {
    align-items: flex-start;
}

.hfe-direction-vertical.hfe-align-center .hfe-countdown-container {
    align-items: center;
}

.hfe-direction-vertical.hfe-align-flex-end .hfe-countdown-container {
    align-items: flex-end;
}

.hfe-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 80px;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* سایز آیتم‌ها در حالت عمودی */
.hfe-direction-vertical .hfe-countdown-item {
    min-width: 100px;
    width: auto;
    padding: 20px 15px;
}

/* پس‌زمینه پیش‌فرض برای آیتم‌ها در صورت عدم تنظیم */
.hfe-countdown-item-day {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
}

.hfe-countdown-item-hour {
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
}

.hfe-countdown-item-minute {
    background: linear-gradient(145deg, #4facfe 0%, #00f2fe 100%);
}

.hfe-countdown-item-second {
    background: linear-gradient(145deg, #43e97b 0%, #38f9d7 100%);
}

.hfe-countdown-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    opacity: 0.7;
}

.hfe-countdown-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hfe-countdown-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* سایز اعداد در حالت عمودی */
.hfe-direction-vertical .hfe-countdown-number {
    font-size: 2.2em;
}

.hfe-countdown-label {
    font-size: 0.9em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.hfe-expiry-message {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    padding: 20px;
    background: linear-gradient(145deg, #f6d365 0%, #fda085 100%);
    border-radius: 12px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
    text-align: center;
    width: 100%;
}

/* تراز پیام انقضا برای حالت افقی */
.hfe-direction-horizontal.hfe-align-flex-start .hfe-expiry-message {
    text-align: left;
}

.hfe-direction-horizontal.hfe-align-center .hfe-expiry-message {
    text-align: center;
}

.hfe-direction-horizontal.hfe-align-flex-end .hfe-expiry-message {
    text-align: right;
}

/* تراز پیام انقضا برای حالت عمودی */
.hfe-direction-vertical .hfe-expiry-message {
    text-align: center;
}

/* انیمیشن شمارش معکوس */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.hfe-countdown-item.changing {
    animation: pulse 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* استایل واکنش گرا */
@media (max-width: 1024px) {
    .hfe-direction-horizontal .hfe-countdown-container {
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    .hfe-countdown-item {
        min-width: 70px;
        min-height: 70px;
        padding: 12px;
    }
    
    .hfe-direction-vertical .hfe-countdown-item {
        min-width: 90px;
        padding: 18px 12px;
    }
    
    .hfe-countdown-number {
        font-size: 2em;
    }
    
    .hfe-direction-vertical .hfe-countdown-number {
        font-size: 1.8em;
    }
    
    .hfe-countdown-label {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    /* در موبایل، حالت عمودی به افقی تغییر می‌کند */
    .hfe-direction-vertical .hfe-countdown-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 10px;
    }
    
    .hfe-direction-vertical .hfe-countdown-item {
        min-width: 70px;
        min-height: 70px;
        padding: 12px;
        margin-bottom: 0 !important;
        margin-left: 5px;
        margin-right: 5px;
    }
    
    .hfe-countdown-item {
        min-width: 60px;
        min-height: 60px;
        padding: 10px;
    }
    
    .hfe-countdown-number {
        font-size: 1.7em;
    }
    
    .hfe-countdown-label {
        font-size: 0.7em;
    }
    
    .hfe-expiry-message {
        font-size: 1.2em;
        padding: 15px;
    }
}

/* استایل برای RTL (پشتیبانی از زبان فارسی) */
body.rtl .hfe-countdown-container {
    direction: ltr;
}

/* جهت نمایش اعداد همیشه از چپ به راست */
.hfe-countdown-number {
    direction: ltr;
    unicode-bidi: embed;
}

/* برای جلوگیری از تغییر جهت توسط وردپرس RTL */
.hfe-countdown-timer,
.hfe-countdown-timer * {
    direction: ltr !important;
}

/* متن پیام انقضا در RTL */
body.rtl .hfe-expiry-message {
    direction: rtl;
    text-align: right;
}

/* تنظیم تراز در حالت RTL */
body.rtl .hfe-direction-horizontal.hfe-align-flex-start .hfe-expiry-message {
    text-align: right;
}

body.rtl .hfe-direction-horizontal.hfe-align-flex-end .hfe-expiry-message {
    text-align: left;
}