/* Custom Countdown Styles */
.custom-countdown-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.custom-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    min-width: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-countdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.custom-countdown-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #333333;
    line-height: 1;
    margin-bottom: 5px;
    display: block;
    transition: all 0.3s ease;
}

.custom-countdown-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
    transition: all 0.3s ease;
}

.countdown-expired {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff0000;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: #fff5f5;
    border: 2px solid #ff0000;
    animation: expired-pulse 2s infinite;
}

/* Pulse Animation for Seconds */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.custom-countdown-item.pulse {
    animation: pulse 0.6s ease-in-out;
}

.custom-countdown-item[data-unit="seconds"].pulse .custom-countdown-number {
    color: #007cba;
}

/* Expired Message Animation */
@keyframes expired-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Urgent State (Last 10 seconds) */
.custom-countdown-wrapper.countdown-urgent .custom-countdown-item {
    animation: urgent-shake 0.5s infinite;
    background-color: #ffebee;
    border: 2px solid #f44336;
}

.custom-countdown-wrapper.countdown-urgent .custom-countdown-number {
    color: #f44336;
}

.custom-countdown-wrapper.countdown-urgent .custom-countdown-label {
    color: #f44336;
}

@keyframes urgent-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* Restart Animation for Recurring Countdowns */
.custom-countdown-wrapper.countdown-restart {
    animation: restart-bounce 1s ease-out;
}

@keyframes restart-bounce {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-countdown-wrapper.countdown-restart .custom-countdown-item {
    animation: item-bounce 1s ease-out;
}

@keyframes item-bounce {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    60% {
        transform: translateY(-5px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-countdown-wrapper {
        gap: 15px;
    }
    
    .custom-countdown-item {
        padding: 15px 10px;
        min-width: 60px;
    }
    
    .custom-countdown-number {
        font-size: 2em;
    }
    
    .custom-countdown-label {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .custom-countdown-wrapper {
        gap: 10px;
    }
    
    .custom-countdown-item {
        padding: 12px 8px;
        min-width: 50px;
    }
    
    .custom-countdown-number {
        font-size: 1.5em;
    }
    
    .custom-countdown-label {
        font-size: 0.7em;
    }
    
    .countdown-expired {
        font-size: 1.2em;
        padding: 15px;
    }
}

/* Column Layout Support */
.custom-countdown-wrapper[style*="flex-direction: column"] {
    align-items: center;
}

.custom-countdown-wrapper[style*="flex-direction: column"] .custom-countdown-item {
    width: 100%;
    max-width: 200px;
}

/* Accessibility Improvements */
.custom-countdown-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .custom-countdown-wrapper {
        color: #000 !important;
        background: none !important;
    }
    
    .custom-countdown-item {
        background: none !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .custom-countdown-number,
    .custom-countdown-label {
        color: #000 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .custom-countdown-item {
        background-color: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .custom-countdown-number {
        color: #e2e8f0;
    }
    
    .custom-countdown-label {
        color: #a0aec0;
    }
    
    .countdown-expired {
        background-color: #2d1b1b;
        color: #ff6b6b;
        border-color: #ff6b6b;
    }
    
    .custom-countdown-wrapper.countdown-urgent .custom-countdown-item {
        background-color: #2d1b1b;
        border-color: #ff6b6b;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .custom-countdown-item {
        border: 2px solid;
        background-color: transparent;
    }
    
    .custom-countdown-number,
    .custom-countdown-label {
        font-weight: bold;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .custom-countdown-item,
    .custom-countdown-wrapper,
    .countdown-expired {
        animation: none !important;
        transition: none !important;
    }
    
    .custom-countdown-item:hover {
        transform: none;
    }
}

/* Debug Styles */
.countdown-debug {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 10px;
    opacity: 0.7;
}

.countdown-debug div {
    margin: 2px 0;
}

/* Loading State */
.custom-countdown-wrapper.loading {
    opacity: 0.6;
}

.custom-countdown-wrapper.loading .custom-countdown-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Bangla Font Support */
.custom-countdown-wrapper[data-language="bangla"] .custom-countdown-number,
.custom-countdown-wrapper[data-language="bangla"] .custom-countdown-label {
    font-family: 'SolaimanLipi', 'Kalpurush', 'Nikosh', Arial, sans-serif;
}

/* Custom Elementor Integration */
.elementor-widget-custom-countdown .custom-countdown-wrapper {
    margin: 0;
}

/* Additional Effects for Different Countdown States */
.custom-countdown-item {
    background: #764ba2;
    color: white;
}

