/* استایل اصلی شمارش معکوس */
.behtarinzaman-countdown-container {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px 0;
}

.behtarinzaman-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.behtarinzaman-link:hover .behtarinzaman-countdown-box {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.behtarinzaman-countdown-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.behtarinzaman-countdown-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.behtarinzaman-header,
.behtarinzaman-timer,
.behtarinzaman-description {
    position: relative;
    z-index: 2;
}

/* عنوان سفید و بولد */
.behtarinzaman-header h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    text-align: center;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.behtarinzaman-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* ترتیب فارسی: ثانیه (راست) به روز (چپ) */
.behtarinzaman-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 15px 10px;
    min-width: 80px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    max-width: 120px;
}

.behtarinzaman-time-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
}

.behtarinzaman-time-label {
    font-size: 14px;
    opacity: 0.9;
}

.behtarinzaman-time-separator {
    font-size: 30px;
    font-weight: bold;
    margin: 0 5px;
    align-self: flex-end;
    margin-bottom: 15px;
    opacity: 0.8;
}

.behtarinzaman-description {
    text-align: center;
    font-size: 16px;
    opacity: 0.9;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* حالت شناور - کمی پایین‌تر */
.behtarinzaman-floating-wrapper {
    position: fixed;
    top: 60%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 9999;
    transition: all 0.3s ease;
}

.behtarinzaman-floating-wrapper .behtarinzaman-floating-content {
    display: block;
}

.behtarinzaman-floating-wrapper.behtarinzaman-collapsed .behtarinzaman-floating-content {
    display: none;
}

.behtarinzaman-floating-wrapper.behtarinzaman-collapsed .behtarinzaman-toggle-floating {
    display: flex;
}

/* دکمه با آیکون سفارشی - کمی بزرگ‌تر */
.behtarinzaman-toggle-floating {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.3s ease;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    font-size: 0;
    padding: 0;
    overflow: hidden;
}

/* آیکون سفارشی شما - کمی بزرگ‌تر */
.behtarinzaman-toggle-floating::before {
    content: '';
    display: block;
    width: 60px;
    height: 60px;
    background-image: url('https://pelicanacademy.ir/wp-content/uploads/2026/01/Untitled-2.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.behtarinzaman-toggle-floating:hover {
    transform: translateY(-50%) scale(1.1);
    background: transparent !important;
    box-shadow: none !important;
}

.behtarinzaman-toggle-floating:hover::before {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.behtarinzaman-floating-content {
    position: relative;
    animation: slideInLeft 0.5s ease-out;
}

/* رنگ ضربدر #96405f */
.behtarinzaman-close-floating {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #96405f !important;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    z-index: 10000;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.behtarinzaman-close-floating:hover {
    background: #b34d72 !important;
    transform: scale(1.1);
}

.behtarinzaman-floating-wrapper .behtarinzaman-countdown-box {
    max-width: 350px;
    padding: 20px;
    margin: 0;
}

.behtarinzaman-floating-wrapper .behtarinzaman-time-unit {
    min-width: 60px;
    padding: 10px 5px;
    flex: 1;
    max-width: 80px;
}

.behtarinzaman-floating-wrapper .behtarinzaman-time-value {
    font-size: 28px;
}

.behtarinzaman-floating-wrapper .behtarinzaman-time-label {
    font-size: 12px;
}

.behtarinzaman-floating-wrapper .behtarinzaman-time-separator {
    font-size: 24px;
    margin-bottom: 10px;
}

.behtarinzaman-floating-wrapper .behtarinzaman-header h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.behtarinzaman-floating-wrapper .behtarinzaman-description {
    font-size: 14px;
}

/* انیمیشن */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* وضعیت زمانی که به پایان رسیده */
.behtarinzaman-countdown.expired {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

/* حالت پاسخگو - رفع مشکل نمایش در موبایل */
@media (max-width: 768px) {
    .behtarinzaman-timer {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .behtarinzaman-time-unit {
        min-width: 60px;
        padding: 10px 5px;
        flex: 1 1 calc(25% - 10px);
        max-width: calc(25% - 10px);
        margin-bottom: 5px;
    }
    
    .behtarinzaman-time-value {
        font-size: 24px;
    }
    
    .behtarinzaman-time-label {
        font-size: 11px;
    }
    
    .behtarinzaman-time-separator {
        font-size: 20px;
        margin-bottom: 10px;
        display: none;
    }
    
    .behtarinzaman-timer .behtarinzaman-time-separator:nth-last-child(-n+3) {
        display: none;
    }
    
    .behtarinzaman-floating-wrapper {
        left: 10px;
        top: 65%;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-countdown-box {
        max-width: 280px;
        padding: 15px;
    }
    
    .behtarinzaman-toggle-floating {
        width: 50px;
        height: 50px;
    }
    
    .behtarinzaman-toggle-floating::before {
        width: 50px;
        height: 50px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-timer {
        gap: 3px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-unit {
        min-width: 50px;
        padding: 8px 3px;
        flex: 1 1 calc(25% - 6px);
        max-width: calc(25% - 6px);
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-value {
        font-size: 20px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-label {
        font-size: 10px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-separator {
        font-size: 18px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .behtarinzaman-countdown-box {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .behtarinzaman-time-unit {
        min-width: 45px;
        padding: 8px 3px;
        flex: 1 1 calc(25% - 8px);
        max-width: calc(25% - 8px);
    }
    
    .behtarinzaman-time-value {
        font-size: 20px;
    }
    
    .behtarinzaman-time-label {
        font-size: 10px;
    }
    
    .behtarinzaman-time-separator {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .behtarinzaman-header h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .behtarinzaman-description {
        font-size: 14px;
    }
    
    .behtarinzaman-floating-wrapper {
        left: 5px;
        top: 65%;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-countdown-box {
        max-width: 250px;
        padding: 12px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-unit {
        min-width: 40px;
        padding: 6px 2px;
        flex: 1 1 calc(25% - 4px);
        max-width: calc(25% - 4px);
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-value {
        font-size: 18px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-label {
        font-size: 9px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-separator {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-header h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-description {
        font-size: 12px;
    }
    
    .behtarinzaman-toggle-floating {
        width: 45px;
        height: 45px;
    }
    
    .behtarinzaman-toggle-floating::before {
        width: 45px;
        height: 45px;
    }
}

/* استایل مخصوص حالت جمع شده در موبایل */
@media (max-width: 360px) {
    .behtarinzaman-floating-wrapper .behtarinzaman-countdown-box {
        max-width: 220px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-unit {
        min-width: 35px;
        padding: 5px 2px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-value {
        font-size: 16px;
    }
    
    .behtarinzaman-floating-wrapper .behtarinzaman-time-label {
        font-size: 8px;
    }
    
    .behtarinzaman-toggle-floating {
        width: 40px;
        height: 40px;
    }
    
    .behtarinzaman-toggle-floating::before {
        width: 40px;
        height: 40px;
    }
}