/* WooCommerce  Woo COD Checkout Frontend Styles - Enhanced Design */

:root {
    --wc-quick-cod-primary: var(--primary-color, #0073aa);
    --wc-quick-cod-secondary: var(--secondary-color, #333333);
    --wc-quick-cod-bg: var(--form-bg-color, #ffffff);
    --wc-quick-cod-button-text: var(--button-text-color, #ffffff);
    --wc-quick-cod-border: #e5e5e5;
    --wc-quick-cod-error: #e74c3c;
    --wc-quick-cod-success: #27ae60;
    --wc-quick-cod-warning: #f39c12;
    --wc-quick-cod-info: #3498db;
    --wc-quick-cod-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --wc-quick-cod-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --wc-quick-cod-border-radius: 12px;
    --wc-quick-cod-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Hardware acceleration */
    --wc-quick-cod-hardware-acceleration: translate3d(0, 0, 0);
}
.wc-quick-cod-submit
{
text-align: center;
}
.wc-quick-cod-form-container {
    background: var(--wc-quick-cod-bg);
    border: 1px solid var(--wc-quick-cod-border);
    border-radius: var(--wc-quick-cod-border-radius);
    padding: 40px;
    margin: 40px 0;
    box-shadow: var(--wc-quick-cod-shadow);
    position: relative;
    overflow: hidden;
    transition: var(--wc-quick-cod-transition);
    transform: var(--wc-quick-cod-hardware-acceleration);
    will-change: transform, opacity;
}

.wc-quick-cod-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--wc-quick-cod-primary), var(--wc-quick-cod-info));
}

.wc-quick-cod-form-container:hover {
    box-shadow: var(--wc-quick-cod-shadow-hover);
    transform: translateY(-2px);
}

.wc-quick-cod-title {
    color: var(--wc-quick-cod-secondary);
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.wc-quick-cod-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--wc-quick-cod-primary), var(--wc-quick-cod-info));
    border-radius: 2px;
}

.wc-quick-cod-form {
    max-width: 600px;
    margin: 0 auto;
}

.wc-quick-cod-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.wc-quick-cod-row .wc-quick-cod-field {
    flex: 1;
}

.wc-quick-cod-field {
    margin-bottom: 20px;
}

.wc-quick-cod-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--wc-quick-cod-secondary);
    font-size: 14px;
}

.wc-quick-cod-field .required {
    color: var(--wc-quick-cod-error);
}

.wc-quick-cod-field input,
.wc-quick-cod-field select,
.wc-quick-cod-field textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--wc-quick-cod-border);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    transition: var(--wc-quick-cod-transition);
    box-sizing: border-box;
    font-family: inherit;
}

.wc-quick-cod-field input:focus,
.wc-quick-cod-field select:focus,
.wc-quick-cod-field textarea:focus {
    border-color: var(--wc-quick-cod-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    transform: translateY(-1px);
}

.wc-quick-cod-field input.error,
.wc-quick-cod-field select.error,
.wc-quick-cod-field textarea.error {
    border-color: var(--wc-quick-cod-error);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.wc-quick-cod-button {
    background: linear-gradient(135deg, var(--wc-quick-cod-primary), var(--wc-quick-cod-info));
    color: var(--wc-quick-cod-button-text);
    border: none;
    padding: 18px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--wc-quick-cod-transition);
    min-width: 220px;
    text-align: center;
    font-weight: 600;
    display: inline-block;
    text-decoration: none;
    box-shadow: var(--wc-quick-cod-shadow);
    position: relative;
    overflow: hidden;
}

.wc-quick-cod-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s;
}

.wc-quick-cod-button:hover::before {
    left: 100%;
}

.wc-quick-cod-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--wc-quick-cod-shadow-hover);
}

.wc-quick-cod-button:active {
    transform: translateY(0);
    box-shadow: var(--wc-quick-cod-shadow);
}

.wc-quick-cod-button.loading {
    opacity: 0.8;
    cursor: wait;
    pointer-events: none;
}

.wc-quick-cod-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid var(--wc-quick-cod-border);
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
    transition: var(--wc-quick-cod-transition);
    max-width: 150px;
    margin: 0 auto;
}

.quantity-controls:focus-within {
    border-color: var(--wc-quick-cod-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.qty-btn {
    background: var(--wc-quick-cod-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: var(--wc-quick-cod-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--wc-quick-cod-info);
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

.quantity-controls input[name="quantity"] {
    border: none !important;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    padding: 10px !important;
    box-shadow: none !important;
    background: transparent !important;
    min-width: 60px;
    flex: 1;
}

.quantity-controls input[name="quantity"]:focus {
    outline: none;
}

/* Enhanced Order Summary */
.wc-quick-cod-summary {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid var(--wc-quick-cod-border);
    border-radius: var(--wc-quick-cod-border-radius);
    padding: 25px;
    margin: 25px 0;
    box-shadow: var(--wc-quick-cod-shadow);
    position: relative;
    overflow: hidden;
}

.wc-quick-cod-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wc-quick-cod-primary), var(--wc-quick-cod-info));
}

.wc-quick-cod-summary h4 {
    margin: 0 0 20px 0;
    color: var(--wc-quick-cod-secondary);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-quick-cod-summary h4::before {
    content: '📋';
    font-size: 18px;
}

.product-details {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 115, 170, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--wc-quick-cod-primary);
}

.product-name {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

/* Price Display Styles */
.wc-quick-cod-price-display {
    background: var(--price-bg-color, #f8f9fa);
    border: 2px solid var(--wc-quick-cod-primary);
    border-radius: var(--wc-quick-cod-border-radius);
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--wc-quick-cod-transition);
}

.wc-quick-cod-price-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--wc-quick-cod-transition);
}

.wc-quick-cod-price-display:hover::before {
    left: 100%;
}

.wc-quick-cod-price-label {
    color: var(--price-text-color, #333333);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wc-quick-cod-price-value {
    color: var(--wc-quick-cod-primary);
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wc-quick-cod-price-currency {
    font-size: 24px;
    margin-right: 5px;
}

.wc-quick-cod-price-amount {
    display: inline-block;
    position: relative;
}

.wc-quick-cod-price-display.position-above-title {
    margin-bottom: 15px;
}

.wc-quick-cod-price-display.position-in-header {
    background: var(--wc-quick-cod-primary);
    color: white;
    border-radius: var(--wc-quick-cod-border-radius) var(--wc-quick-cod-border-radius) 0 0;
    margin: -40px -40px 25px -40px;
    border: none;
}

.wc-quick-cod-price-display.position-in-header .wc-quick-cod-price-label {
    color: rgba(255, 255, 255, 0.9);
}

.wc-quick-cod-price-display.position-in-header .wc-quick-cod-price-value {
    color: white;
}

/* Price animations */
@keyframes priceGlow {
    0%, 100% { 
        box-shadow: 0 0 5px var(--wc-quick-cod-primary); 
    }
    50% { 
        box-shadow: 0 0 20px var(--wc-quick-cod-primary), 0 0 30px var(--wc-quick-cod-primary); 
    }
}

.wc-quick-cod-price-display.price-highlight {
    animation: priceGlow 2s infinite;
}

/* Sale price styles */
.wc-quick-cod-price-display .wc-quick-cod-sale-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.wc-quick-cod-price-display .wc-quick-cod-regular-price {
    color: var(--wc-quick-cod-error);
    font-size: 20px;
    text-decoration: line-through;
    opacity: 0.7;
}

.wc-quick-cod-price-display .wc-quick-cod-sale-badge {
    background: var(--wc-quick-cod-error);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Enhanced Messages */
.wc-quick-cod-messages {
    margin: 20px 0;
}

.wc-quick-cod-success,
.wc-quick-cod-error,
.wc-quick-cod-info,
.wc-quick-cod-warning {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--wc-quick-cod-transition);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wc-quick-cod-success.show,
.wc-quick-cod-error.show,
.wc-quick-cod-info.show,
.wc-quick-cod-warning.show {
    opacity: 1;
    transform: translateY(0);
}

.wc-quick-cod-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--wc-quick-cod-success);
}

.wc-quick-cod-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--wc-quick-cod-error);
}

.wc-quick-cod-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--wc-quick-cod-info);
}

.wc-quick-cod-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--wc-quick-cod-warning);
}

.wc-quick-cod-success::before,
.wc-quick-cod-error::before,
.wc-quick-cod-info::before,
.wc-quick-cod-warning::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.wc-quick-cod-success::before {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23155724' viewBox='0 0 16 16'%3e%3cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
}

.wc-quick-cod-error::before {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23721c24' viewBox='0 0 16 16'%3e%3cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Enhanced Field Errors */
.field-error {
    color: var(--wc-quick-cod-error) !important;
    font-size: 13px !important;
    margin-top: 8px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--wc-quick-cod-transition);
}

.field-error.show {
    opacity: 1;
    transform: translateY(0);
}

.field-error::before {
    content: '⚠';
    font-size: 14px;
}

/* Progress Indicator */
.wc-quick-cod-progress {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0;
    opacity: 0;
    transition: var(--wc-quick-cod-transition);
}

.wc-quick-cod-progress.show {
    opacity: 1;
}

.wc-quick-cod-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--wc-quick-cod-primary), var(--wc-quick-cod-info));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Animation Classes */
.wc-quick-cod-form-container.animate-in {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-quick-cod-form.shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.wc-quick-cod-field.focused {
    transform: scale(1.02);
    transition: var(--wc-quick-cod-transition);
}

.wc-quick-cod-field input.valid,
.wc-quick-cod-field select.valid,
.wc-quick-cod-field textarea.valid {
    border-color: var(--wc-quick-cod-success);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Processing Steps */
.wc-quick-cod-processing-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--wc-quick-cod-border-radius);
    border: 1px solid var(--wc-quick-cod-border);
}

.processing-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: var(--wc-quick-cod-transition);
}

.processing-step.active {
    opacity: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wc-quick-cod-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: var(--wc-quick-cod-transition);
}

.processing-step.active .step-icon {
    background: var(--wc-quick-cod-primary);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.step-text {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--wc-quick-cod-secondary);
}

/* Success Celebration */
.wc-quick-cod-success.celebrate {
    animation: celebrate 0.8s ease-out;
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.floating-heart {
    animation: float 3s ease-out forwards;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Button States */
.wc-quick-cod-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.wc-quick-cod-button.ready {
    animation: readyPulse 2s infinite;
}

@keyframes readyPulse {
    0% { box-shadow: var(--wc-quick-cod-shadow); }
    50% { box-shadow: var(--wc-quick-cod-shadow-hover); }
    100% { box-shadow: var(--wc-quick-cod-shadow); }
}

/* Enhanced Tooltips */
.wc-quick-cod-tooltip {
    position: relative;
    display: inline-block;
}

.wc-quick-cod-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wc-quick-cod-secondary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--wc-quick-cod-transition);
    z-index: 1000;
}

.wc-quick-cod-tooltip:hover::after {
    opacity: 1;
}

/* Redirect Notice Styles */
.wc-quick-cod-redirect-notice {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.3);
}

.wc-quick-cod-redirect-notice.show {
    opacity: 1;
    transform: translateY(0);
}

.wc-quick-cod-redirect-notice .redirect-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.wc-quick-cod-redirect-notice .redirect-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.wc-quick-cod-redirect-notice .redirect-content {
    flex: 1;
}

.wc-quick-cod-redirect-notice h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.wc-quick-cod-redirect-notice p {
    margin: 0 0 12px 0;
    font-size: 14px;
    opacity: 0.9;
}

.wc-quick-cod-redirect-notice .redirect-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-quick-cod-redirect-notice .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* RTL Support for Redirect Notice */
[dir="rtl"] .wc-quick-cod-redirect-notice,
.rtl .wc-quick-cod-redirect-notice {
    flex-direction: row-reverse;
}

[dir="rtl"] .wc-quick-cod-redirect-notice .redirect-content,
.rtl .wc-quick-cod-redirect-notice .redirect-content {
    text-align: right;
}

/* Dark Mode Enhanced */
@media (prefers-color-scheme: dark) {
    .wc-quick-cod-form-container {
        background: #1a1a1a;
        border-color: #333;
        color: #fff;
    }
    
    .wc-quick-cod-field input,
    .wc-quick-cod-field select,
    .wc-quick-cod-field textarea {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .wc-quick-cod-summary {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        border-color: #333;
    }
}

/* Print Styles */
@media print {
    .wc-quick-cod-form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wc-quick-cod-button,
    .qty-btn {
        display: none;
    }
}

/* حماية عنصر "Powered by" من الحذف أو الإخفاء */
.wc-quick-cod-powered-by {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    font-size: 12px !important;
    color: #555 !important;
    text-align: center !important;
    margin-top: 15px !important;
    padding: 8px 0 !important;
    border-top: 1px solid #eee !important;
}

.wc-quick-cod-powered-by a {
    color: #0073aa !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

.wc-quick-cod-powered-by a:hover {
    text-decoration: underline !important;
}

/* حماية العناصر الثانوية */
#wc-quick-cod-footer-brand,
.wc-quick-cod-secondary-brand {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* منع CSS المخصص من إخفاء العلامة التجارية */
[class*="powered"] {
    display: block !important;
}

/* حماية من محاولات الإخفاء بواسطة display: none */
*[style*="display: none"] .wc-quick-cod-powered-by,
*[style*="display:none"] .wc-quick-cod-powered-by {
    display: block !important;
}
