/**
 * Ciruderm Promotions - Frontend Styles
 * Version: 2.0.0
 */

/* Promotions Banner */
#ciruderm-promotions-banner {
    background: #fef2f2;
    border: 1px solid #ff4739;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ciruderm-promotions-banner:hover {
    background: #fee2e2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 71, 57, 0.1);
}

/* Promotions Modal */
#ciruderm-promotions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#ciruderm-promotions-modal > div {
    position: absolute;
    right: 0;
    top: 0;
    width: 400px;
    height: 100%;
    background: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

/* Promotion Groups */
.promotion-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
}

.promotion-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.promotion-group-header .icon {
    font-size: 20px;
    margin-right: 10px;
}

.promotion-group-header h4 {
    margin: 0;
    color: #ff4739;
}

.promotion-group-header small {
    color: #6c757d;
}

/* Promotion Options */
.promotion-option {
    margin-bottom: 10px;
}

.promotion-option label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.promotion-option label:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.promotion-option label.selected {
    background: #d1ecf1;
    border-color: #bee5eb;
}

.promotion-option input[type="radio"] {
    margin-right: 10px;
}

.promotion-option-content {
    flex: 1;
}

.promotion-option-title {
    font-weight: bold;
    margin-bottom: 2px;
}

.promotion-option-description {
    font-size: 12px;
    color: #6c757d;
}

/* Disabled Promotion Options */
.promotion-option.disabled {
    opacity: 0.7;
    background: #f8f9fa;
}

.promotion-option.disabled label {
    cursor: not-allowed;
}

.promotion-option.disabled .promotion-option-title {
    color: #6c757d;
}

.promotion-option.disabled .promotion-option-description {
    color: #dc3545;
}

/* Apply Button */
#apply-selected-promotions {
    width: 100%;
    background: #ff4739;
    color: white;
    border: none;
    padding: 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#apply-selected-promotions:hover {
    background: #e63946;
    transform: translateY(-1px);
}

#apply-selected-promotions:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Cart Totals Promotions */
.ciruderm-applied-promotions td {
    width: 100% !important;
    padding: 15px;
    vertical-align: top !important;
}

.ciruderm-applied-promotions td div {
    display: block;
    width: 100%;
    color: #000;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ciruderm-promotions-modal > div {
        width: 100%;
        right: 0;
    }
    
    .promotion-group {
        padding: 10px;
    }
    
    .promotion-option label {
        padding: 8px;
    }
}

/* Close Button */
#close-promotions-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
}

#close-promotions-modal:hover {
    color: #dc3545;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    position: relative;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border-radius: 12px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.loading::before {
    content: '🎁';
    display: block;
    font-size: 48px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.loading::after {
    content: '';
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff4739;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Loading Progress Bar */
.loading-progress {
    width: 100%;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4739, #ff6b5b);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

/* Loading Dots */
.loading-dots {
    display: inline-block;
    margin: 0 5px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

/* Loading Messages */
.loading-message {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-top: 20px;
    text-align: center;
    line-height: 1.4;
}

/* Enhanced Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}



/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Loading Shimmer Effect */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
} 