/**
 * 211J Countdown Timer for WooCommerce - Frontend Styles
 */

.countdown-timer-for-woocommerce {
    margin: 15px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.countdown-timer-for-woocommerce::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.countdown-active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.countdown-message {
    font-size: 16px;
    font-weight: 600;
    color: #155724;
    line-height: 1.4;
    margin: 0;
}

.countdown-time {
    font-family: 'Courier New', Monaco, monospace;
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #28a745;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Urgency states */
.countdown-timer-for-woocommerce.urgent {
    border-color: #ffc107;
    background: #fff3cd;
    animation: pulse-urgent 2s infinite;
}

.countdown-timer-for-woocommerce.urgent .countdown-message {
    color: #856404;
}

.countdown-timer-for-woocommerce.urgent .countdown-time {
    color: #ffc107;
    border-color: #ffc107;
}

.countdown-timer-for-woocommerce.very-urgent {
    border-color: #dc3545;
    background: #f8d7da;
    animation: pulse-very-urgent 1s infinite;
}

.countdown-timer-for-woocommerce.very-urgent .countdown-message {
    color: #721c24;
}

.countdown-timer-for-woocommerce.very-urgent .countdown-time {
    color: #dc3545;
    border-color: #dc3545;
    animation: blink 0.8s infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

@keyframes pulse-very-urgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.5;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .countdown-timer-for-woocommerce {
        margin: 10px 0;
        padding: 10px 12px;
    }
    
    .countdown-message {
        font-size: 14px;
    }
    
    .countdown-time {
        font-size: 16px;
        padding: 3px 6px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .countdown-active {
        flex-direction: column;
        gap: 6px;
    }
    
    .countdown-message {
        font-size: 13px;
        text-align: center;
    }
    
    .countdown-time {
        font-size: 15px;
        padding: 4px 8px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .countdown-timer-for-woocommerce {
        border-width: 3px;
    }
    
    .countdown-time {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .countdown-timer-for-woocommerce::before,
    .countdown-timer-for-woocommerce.urgent,
    .countdown-timer-for-woocommerce.very-urgent,
    .countdown-time {
        animation: none;
    }
}

/* Focus styles for accessibility */
.countdown-timer-for-woocommerce:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .countdown-timer-for-woocommerce {
        background: transparent !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
        animation: none !important;
    }
    
    .countdown-time {
        background: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Admin styles */
.countdown-timer-admin-page input[type="text"],
.countdown-timer-admin-page input[type="time"],
.countdown-timer-admin-page textarea,
.countdown-timer-admin-page select {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.countdown-timer-admin-page input[type="text"]:focus,
.countdown-timer-admin-page input[type="time"]:focus,
.countdown-timer-admin-page textarea:focus,
.countdown-timer-admin-page select:focus {
    background-color: #fff;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: 2px solid transparent;
}

/* Dark mode support for admin */
@media (prefers-color-scheme: dark) {
    .countdown-timer-admin-page input[type="text"],
    .countdown-timer-admin-page input[type="time"],
    .countdown-timer-admin-page textarea,
    .countdown-timer-admin-page select {
        background-color: #2c3338;
        color: #fff;
        border-color: #50575e;
    }
    
    .countdown-timer-admin-page input[type="text"]:focus,
    .countdown-timer-admin-page input[type="time"]:focus,
    .countdown-timer-admin-page textarea:focus,
    .countdown-timer-admin-page select:focus {
        background-color: #1d2327;
        border-color: #2271b1;
        box-shadow: 0 0 0 1px #2271b1;
    }
}