/**
 * Frontend Coupon Scheduler Styles
 * Version: 1.0.0
 */

/* ==========================================================================
   Banner Countdown Styles
   ========================================================================== */

.fcs-banner {
    background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
    position: relative;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    transition: all 0.3s ease;
}

/* Banner Position Variations */
.fcs-banner.fcs-banner-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
}

.fcs-banner.fcs-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
}

.fcs-banner.fcs-banner-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: fcsFloatIn 0.5s ease;
}

@keyframes fcsFloatIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Banner Content Layout */
.fcs-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.fcs-banner-text {
    flex: 1;
    font-size: 16px;
    text-align: left;
    line-height: 1.5;
}

.fcs-banner-icon {
    margin-right: 10px;
    font-size: 20px;
    animation: fcsBounce 2s infinite;
}

@keyframes fcsBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Coupon Code Display */
.fcs-coupon-code {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    margin: 0 5px;
    font-weight: bold;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    display: inline-block;
    transition: all 0.3s;
}

.fcs-coupon-code:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Countdown Timer */
.fcs-countdown-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fcs-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.fcs-timer-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.fcs-timer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.9);
}

.fcs-timer-separator {
    font-size: 20px;
    font-weight: bold;
    margin: 0 2px;
    color: #FFD700;
    opacity: 0.7;
}

/* Close Button */
.fcs-close-banner {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcs-close-banner:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Banner Actions */
.fcs-banner-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.fcs-copy-coupon {
    background: rgba(255, 255, 255, 0.9);
    color: #8B0000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.fcs-copy-coupon:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.fcs-go-to-cart {
    background: #FFD700;
    color: #8B0000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-block;
}

.fcs-go-to-cart:hover {
    background: #FFE44D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: #8B0000;
}

/* ==========================================================================
   BOGO Special Banner Styles
   ========================================================================== */

.fcs-bogo-special-banner {
    background: linear-gradient(135deg, #8B0000 0%, #FF6B6B 100%);
    border: 3px solid #FFD700;
    animation: fcsPulseBorder 2s infinite;
}

@keyframes fcsPulseBorder {
    0%, 100% { border-color: #FFD700; }
    50% { border-color: #FFA500; }
}

.fcs-bogo-rule {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    font-weight: bold;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fcs-bogo-rule .fcs-buy {
    color: #FFD700;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
}

.fcs-bogo-rule .fcs-get {
    color: #4CAF50;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
}

.fcs-bogo-rule .fcs-arrow {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.fcs-more-bogo-offers {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.8;
}

/* ==========================================================================
   Coupon Form Popup Styles
   ========================================================================== */

.fcs-coupon-form-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
    animation: fcsFadeIn 0.3s ease;
}

@keyframes fcsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fcs-coupon-form-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fcsPopupSlideIn 0.3s ease;
}

@keyframes fcsPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fcs-coupon-form-content h3 {
    margin-top: 0;
    color: #8B0000;
    margin-bottom: 15px;
}

.fcs-coupon-input-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.fcs-coupon-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #8B0000;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-align: center;
    font-weight: bold;
}

.fcs-copy-coupon-btn {
    background: #8B0000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.fcs-copy-coupon-btn:hover {
    background: #A52A2A;
    transform: translateY(-2px);
}

.fcs-coupon-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.fcs-go-to-cart-btn {
    flex: 1;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

.fcs-go-to-cart-btn:hover {
    background: #66BB6A;
    transform: translateY(-2px);
}

.fcs-close-popup {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.fcs-close-popup:hover {
    background: #e0e0e0;
}

/* ==========================================================================
   Shortcode Styles
   ========================================================================== */

.fcs-countdown-shortcode {
    background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
    color: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.fcs-countdown-shortcode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="none" stroke="white" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-size: 100px;
    opacity: 0.1;
    z-index: 0;
}

.fcs-countdown-shortcode-content {
    position: relative;
    z-index: 1;
}

.fcs-countdown-shortcode-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.fcs-countdown-shortcode-timer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.fcs-countdown-shortcode-unit {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    min-width: 70px;
}

.fcs-countdown-shortcode-value {
    font-size: 32px;
    font-weight: 700;
    color: #FFD700;
    line-height: 1;
}

.fcs-countdown-shortcode-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    opacity: 0.9;
}

.fcs-countdown-shortcode-coupon {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    display: inline-block;
    margin: 10px 0;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.fcs-countdown-shortcode-cta {
    margin-top: 20px;
}

.fcs-countdown-shortcode-cta .fcs-go-to-cart {
    background: #FFD700;
    color: #8B0000;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.fcs-countdown-shortcode-cta .fcs-go-to-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    background: #FFE44D;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .fcs-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .fcs-banner-text {
        text-align: center;
        font-size: 14px;
    }
    
    .fcs-countdown-timer {
        justify-content: center;
    }
    
    .fcs-timer-unit {
        min-width: 45px;
    }
    
    .fcs-timer-value {
        font-size: 20px;
    }
    
    .fcs-banner.fcs-banner-floating {
        width: 90%;
        right: 5%;
        bottom: 10px;
    }
    
    .fcs-countdown-shortcode-timer {
        flex-wrap: wrap;
    }
    
    .fcs-countdown-shortcode-unit {
        min-width: 60px;
    }
    
    .fcs-countdown-shortcode-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .fcs-banner {
        padding: 10px 15px;
    }
    
    .fcs-timer-unit {
        min-width: 40px;
    }
    
    .fcs-timer-value {
        font-size: 18px;
    }
    
    .fcs-banner-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .fcs-copy-coupon,
    .fcs-go-to-cart {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Animation & Effects
   ========================================================================== */

@keyframes fcsPulseUrgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.fcs-countdown-urgent .fcs-timer-value {
    animation: fcsPulseUrgent 1s infinite;
    color: #FF0000;
}

/* Success message for coupon copy */
.fcs-coupon-copied {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10002;
    animation: fcsSlideInRight 0.3s ease, fcsFadeOut 0.3s ease 2.7s forwards;
}

@keyframes fcsSlideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fcsFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==========================================================================
   WordPress Admin Bar Adjustments
   ========================================================================== */

.admin-bar .fcs-banner.fcs-banner-top {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .fcs-banner.fcs-banner-top {
        top: 46px;
    }
}

/* ==========================================================================
   WooCommerce Compatibility
   ========================================================================== */

.woocommerce-cart .fcs-banner,
.woocommerce-checkout .fcs-banner {
    display: none !important;
}

/* ==========================================================================
   Accessibility & Focus Styles
   ========================================================================== */

.fcs-copy-coupon:focus,
.fcs-go-to-cart:focus,
.fcs-close-banner:focus,
.fcs-copy-coupon-btn:focus,
.fcs-go-to-cart-btn:focus,
.fcs-close-popup:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .fcs-banner,
    .fcs-coupon-form-popup,
    .fcs-countdown-shortcode {
        display: none !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .fcs-banner {
        border: 2px solid white;
    }
    
    .fcs-coupon-code {
        border: 1px solid white;
    }
    
    .fcs-countdown-timer {
        border: 1px solid white;
    }
}

/* ==========================================================================
   Reduced Motion Preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .fcs-banner,
    .fcs-coupon-form-popup,
    .fcs-countdown-shortcode,
    .fcs-coupon-copied {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fcs-banner-icon,
    .fcs-countdown-urgent .fcs-timer-value {
        animation: none !important;
    }
    
    .fcs-copy-coupon:hover,
    .fcs-go-to-cart:hover,
    .fcs-copy-coupon-btn:hover,
    .fcs-go-to-cart-btn:hover {
        transform: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .fcs-coupon-form-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .fcs-coupon-input {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #8B0000;
    }
    
    .fcs-close-popup {
        background: #333333;
        color: #ffffff;
    }
    
    .fcs-close-popup:hover {
        background: #444444;
    }
}