/* Public styles */
#datepicker { 
    width: 100%; 
    padding: 10px; 
    font-size: 16px; 
}

.ui-datepicker { 
    z-index: 9999 !important; 
}

/* Datepicker navigation arrows */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    position: absolute;
    top: 2px;
    width: 1.8em;
    height: 1.8em;
}

.ui-datepicker .ui-datepicker-prev {
    left: 2px;
}

.ui-datepicker .ui-datepicker-next {
    right: 2px;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: #f0f0f0;
    border-radius: 4px;
}

/* Arrow icons using CSS */
.ui-datepicker .ui-datepicker-prev span::before,
.ui-datepicker .ui-datepicker-next span::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border: 2px solid #333;
    border-right: none;
    border-bottom: none;
}

.ui-datepicker .ui-datepicker-prev span::before {
    transform: rotate(-45deg);
    margin-left: 4px;
}

.ui-datepicker .ui-datepicker-next span::before {
    transform: rotate(135deg);
    margin-left: -4px;
}

.ui-datepicker .ui-icon {
    width: 16px;
    height: 16px;
    text-indent: -99999px;
    overflow: hidden;
    background-image: none !important;
}

.ddsr-delivery-date-wrapper #datepicker {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
    padding-right: 40px !important;
    cursor: pointer;
}

/* ========================================
   Delivery Date Required Error Styling
   ======================================== */

.ddsr-delivery-date-wrapper.woocommerce-invalid #datepicker,
.ddsr-delivery-date-wrapper.woocommerce-invalid-required-field #datepicker {
    border: 2px solid #e2401c !important;
    background-color: #fff8f7 !important;
    animation: ddsr-shake 0.5s ease-in-out;
}

@keyframes ddsr-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Prominent error notice for delivery date */
.ddsr-date-error-notice {
    background: linear-gradient(135deg, #e2401c 0%, #c9302c 100%) !important;
    color: #fff !important;
    padding: 15px 20px !important;
    margin: 15px 0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(226, 64, 28, 0.4) !important;
    border: none !important;
    animation: ddsr-pulse 2s infinite;
}

@keyframes ddsr-pulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(226, 64, 28, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(226, 64, 28, 0.6);
        transform: scale(1.01);
    }
}

/* Label indicator for required field */
.ddsr-delivery-date-wrapper.validate-required label::after {
    content: ' *';
    color: #e2401c;
    font-weight: bold;
}

/* Highlight the whole wrapper when invalid */
.ddsr-delivery-date-wrapper.woocommerce-invalid,
.ddsr-delivery-date-wrapper.woocommerce-invalid-required-field {
    background: #fff8f7;
    border: 2px solid #e2401c;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.shipping-method-hidden {
    display: none !important;
}

/* ========================================
   Shipping Confirmation Popup
   ======================================== */

.ddsr-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ddsr-fade-in 0.2s ease;
}

@keyframes ddsr-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ddsr-confirm-popup {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: ddsr-slide-up 0.3s ease;
}

@keyframes ddsr-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ddsr-confirm-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.ddsr-confirm-message {
    margin: 0 0 25px 0;
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

.ddsr-confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.ddsr-confirm-buttons button {
    padding: 12px 25px;
    font-size: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.ddsr-confirm-yes {
    background: #4CAF50 !important;
    color: #fff !important;
    border: none !important;
}

.ddsr-confirm-yes:hover {
    background: #45a049 !important;
}

.ddsr-confirm-no {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
}

.ddsr-confirm-no:hover {
    background: #e8e8e8 !important;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .ddsr-confirm-popup {
        padding: 20px;
    }
    
    .ddsr-confirm-title {
        font-size: 18px;
    }
    
    .ddsr-confirm-message {
        font-size: 14px;
    }
    
    .ddsr-confirm-buttons {
        flex-direction: column;
    }
    
    .ddsr-confirm-buttons button {
        width: 100%;
    }
}
