/* Azadi Sale Price Plugin Styles */

.azadi-sale-container {
    position: relative;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Theme: Green (Azadi) */
.azadi-sale-container.theme-green {
    background: linear-gradient(135deg, 
        #28a745 0%, 
        #20c997 15%, 
        #198754 30%, 
        #146c43 45%, 
        #0f5132 60%, 
        #0a3623 75%, 
        #051b11 90%, 
        #00ff00 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.25);
}

.azadi-sale-container.theme-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}

/* Theme: New Year (Red & Gold) */
.azadi-sale-container.theme-new-year {
    background: linear-gradient(135deg, 
        #dc3545 0%, 
        #c82333 15%, 
        #ff6b6b 30%, 
        #ffa500 45%, 
        #ffd700 60%, 
        #ffed4e 75%, 
        #ff8c00 90%, 
        #ff4500 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.35);
}

.azadi-sale-container.theme-new-year:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.45);
}

/* Default fallback - if no theme class is set, use green */
.azadi-sale-container:not(.theme-green):not(.theme-new-year) {
    background: linear-gradient(135deg, 
        #28a745 0%, 
        #20c997 15%, 
        #198754 30%, 
        #146c43 45%, 
        #0f5132 60%, 
        #0a3623 75%, 
        #051b11 90%, 
        #00ff00 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.25);
}

.azadi-sale-container:not(.theme-green):not(.theme-new-year):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}

.azadi-sale-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.azadi-sale-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.azadi-sale-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.1;
}

.azadi-sale-price {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.0;
}

/* Price range styling for variable products */
.azadi-sale-price.azadi-price-range {
    font-size: 22px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .azadi-sale-price.azadi-price-range {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .azadi-sale-price.azadi-price-range {
        font-size: 16px;
    }
}

.azadi-sale-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.1;
}

.azadi-sale-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.countdown-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
    text-align: right;
    line-height: 1.1;
}

.countdown-timer {
    display: flex;
    gap: 8px;
    align-items: center;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 35px;
}

.countdown-number {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 8px;
    border-radius: 4px;
    min-width: 35px;
    text-align: center;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
}

.countdown-item .countdown-label {
    font-size: 8px;
    margin-top: 2px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
}

/* Pakistani Flag Waving Animation - Stable Corners */
.flag-waving {
    position: relative;
    overflow: hidden;
}

.flag-waving::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 10%, 
        rgba(255,255,255,0.08) 30%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.08) 70%, 
        transparent 90%);
    animation: flagWave 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(0.5px);
    transform-origin: left center;
}

.flag-waving::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 20%, 
        rgba(255,255,255,0.05) 40%, 
        rgba(255,255,255,0.1) 60%, 
        transparent 80%);
    animation: flagWave 12s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 1;
    filter: blur(1px);
    transform-origin: left center;
}

@keyframes flagWave {
    0% { 
        left: -100%; 
        transform: translateX(0) scaleY(1) rotateY(0deg); 
    }
    25% { 
        left: -50%; 
        transform: translateX(5px) scaleY(1.05) rotateY(2deg); 
    }
    50% { 
        left: 0%; 
        transform: translateX(0) scaleY(1) rotateY(0deg); 
    }
    75% { 
        left: 50%; 
        transform: translateX(-5px) scaleY(0.95) rotateY(-2deg); 
    }
    100% { 
        left: 100%; 
        transform: translateX(0) scaleY(1) rotateY(0deg); 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .azadi-sale-container {
        padding: 12px 15px;
        margin: 10px 0;
    }
    
    .azadi-sale-content {
        gap: 15px;
    }
    
    .azadi-sale-title {
        font-size: 14px;
    }
    
    .azadi-sale-price {
        font-size: 20px;
    }
    
    .azadi-sale-text {
        font-size: 12px;
    }
    
    .countdown-timer {
        gap: 6px;
    }
    
    .countdown-item {
        min-width: 30px;
    }
    
    .countdown-number {
        font-size: 14px;
        padding: 4px 6px;
        min-width: 30px;
    }
    
    .countdown-item .countdown-label {
        font-size: 7px;
    }
    
    .countdown-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .azadi-sale-container {
        padding: 10px 12px;
    }
    
    .azadi-sale-content {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    
    .azadi-sale-right {
        align-items: flex-end;
        width: auto;
    }
    
    .countdown-label {
        text-align: right;
    }
    
    .azadi-sale-title {
        font-size: 13px;
    }
    
    .azadi-sale-price {
        font-size: 18px;
    }
    
    .azadi-sale-text {
        font-size: 11px;
    }
    
    .countdown-timer {
        gap: 5px;
    }
    
    .countdown-item {
        min-width: 25px;
    }
    
    .countdown-number {
        font-size: 12px;
        padding: 3px 5px;
        min-width: 25px;
    }
    
    .countdown-item .countdown-label {
        font-size: 6px;
    }
    
    /* Loop version - no countdown, full width left content */
    .azadi-sale-loop .azadi-sale-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .azadi-sale-loop .azadi-sale-left {
        width: 100%;
    }
}

/* Admin Settings Styles */
#azadi-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#azadi-preview .azadi-sale-container {
    margin: 0;
    max-width: 400px;
}

/* WooCommerce Integration */
.woocommerce .azadi-sale-container {
    margin: 10px 0;
}

.woocommerce .product .azadi-sale-container {
    margin-top: 15px;
}

/* Loop version styles */
.azadi-sale-loop {
    margin: 8px 0;
}

.azadi-sale-loop .azadi-sale-content {
    justify-content: flex-start;
}

.azadi-sale-loop .azadi-sale-left {
    flex: 1;
}

/* Theme Compatibility */
.theme-twenty-twenty-one .azadi-sale-container,
.theme-twenty-twenty-two .azadi-sale-container,
.theme-twenty-twenty-three .azadi-sale-container {
    border-radius: 6px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .azadi-sale-container {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .azadi-sale-container:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .azadi-sale-container {
        border: 2px solid #ffffff;
    }
    
    .countdown-number {
        border: 1px solid #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .flag-waving::before {
        animation: none;
    }
    
    .flag-symbol {
        animation: none;
    }
    
    .azadi-sale-container:hover {
        transform: none;
    }
}

/* Top Notification Banner */
.azadi-top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Top Banner Theme: Green (Azadi) */
.azadi-top-banner.theme-green {
    background: linear-gradient(135deg, 
        #28a745 0%, 
        #20c997 15%, 
        #198754 30%, 
        #146c43 45%, 
        #0f5132 60%, 
        #0a3623 75%, 
        #051b11 90%, 
        #00ff00 100%);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

/* Top Banner Theme: New Year (Red & Gold) */
.azadi-top-banner.theme-new-year {
    background: linear-gradient(135deg, 
        #dc3545 0%, 
        #c82333 15%, 
        #ff6b6b 30%, 
        #ffa500 45%, 
        #ffd700 60%, 
        #ffed4e 75%, 
        #ff8c00 90%, 
        #ff4500 100%);
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.4);
}

/* Default fallback for top banner */
.azadi-top-banner:not(.theme-green):not(.theme-new-year) {
    background: linear-gradient(135deg, 
        #28a745 0%, 
        #20c997 15%, 
        #198754 30%, 
        #146c43 45%, 
        #0f5132 60%, 
        #0a3623 75%, 
        #051b11 90%, 
        #00ff00 100%);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.azadi-top-banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.azadi-top-banner-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Close button for top banner */
.azadi-top-banner-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.azadi-top-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Mobile sliding text animation - Fixed continuous scrolling */
@media (max-width: 768px) {
    .azadi-top-banner-content {
        overflow: hidden;
        position: relative;
    }
    
    .azadi-top-banner-text {
        animation: slideText 15s linear infinite;
        white-space: nowrap;
        display: inline-block;
        position: relative;
    }
    
    @keyframes slideText {
        0% {
            transform: translateX(100%);
        }
        100% {
            transform: translateX(-100%);
        }
    }
    
    /* Adjust close button position for mobile */
    .azadi-top-banner-close {
        right: 10px;
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Adjust body padding to account for fixed banner */
body {
    padding-top: 40px;
}

/* Admin bar compatibility */
.admin-bar .azadi-top-banner {
    top: 32px;
}

.admin-bar body {
    padding-top: 72px;
} 