/**
 * Sendo One Shipping - Frontend Styles
 *
 * @package Sendo_One
 * @version 5.0.0
 */

/* Pickup point wrapper */
.sendo-pickup-wrapper {
    margin-top: 12px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}


/* Remove radio button styling from pickup label */
.sendo-pickup-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    padding-left: 0 !important;
    position: relative;
}

.sendo-pickup-wrapper label::before,
.sendo-pickup-wrapper label::after {
    display: none !important;
    content: none !important;
}
.sendo-pickup-wrapper label .required {
    color: #dc2626;
    text-decoration: none;
    border: none;
}





/* Select dropdown */
.sendo-pickup-select,
#sendo_pickup_point {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

.sendo-pickup-select:focus,
#sendo_pickup_point:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sendo-pickup-select:hover,
#sendo_pickup_point:hover {
    border-color: #9ca3af;
}

/* Error state */
.sendo-pickup-select.sendo-error,
#sendo_pickup_point.sendo-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.sendo-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
}

/* Option styling */
.sendo-pickup-select option,
#sendo_pickup_point option {
    padding: 8px 12px;
}

/* Loading state */
.sendo-pickup-wrapper.sendo-loading .sendo-pickup-select,
.sendo-pickup-wrapper.sendo-loading #sendo_pickup_point {
    background-color: #f3f4f6;
    cursor: wait;
}

.sendo-pickup-wrapper.sendo-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: sendo-spin 0.8s linear infinite;
}

@keyframes sendo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sendo-pickup-wrapper {
        padding: 10px;
    }
    
    .sendo-pickup-select,
    #sendo_pickup_point {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Admin order page styling */
.sendo-pickup-admin {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
}

.sendo-pickup-admin h4 {
    margin: 0 0 8px 0;
    color: #2271b1;
    font-size: 13px;
    font-weight: 600;
}

.sendo-pickup-admin h4 .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}

.sendo-pickup-admin p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.sendo-pickup-admin p strong {
    display: block;
    color: #1e3a5f;
}

.sendo-pickup-admin p small {
    color: #646970;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sendo-pickup-select,
    #sendo_pickup_point {
        border-width: 2px;
    }
    
    .sendo-pickup-select:focus,
    #sendo_pickup_point:focus {
        outline: 2px solid #000;
        outline-offset: 2px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .sendo-pickup-wrapper {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .sendo-pickup-wrapper label {
        color: #e5e7eb;
    }
    
    .sendo-pickup-select,
    #sendo_pickup_point {
        background-color: #111827;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .sendo-pickup-select:hover,
    #sendo_pickup_point:hover {
        border-color: #6b7280;
    }
}

/* Print styles */
@media print {
    .sendo-pickup-wrapper {
        background: none;
        border: 1px solid #000;
        padding: 8px;
    }
}


















/* ===========================================
   SHIPPING UPDATE ANIMATION
   =========================================== */

/* Container for animation targeting */
.woocommerce-shipping-methods,
#shipping_method {
    position: relative;
    transition: all 0.3s ease;
}

/* Highlight animation keyframes */
@keyframes sendo-highlight {
    0% {
        background-color: rgba(59, 130, 246, 0.15);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}



/* Pulse animation for the shipping row - more visible */
@keyframes sendo-pulse {
    0% {
        transform: scale(1);
        background-color: rgba(255, 180, 0, 0);
    }
    50% {
        transform: scale(1.02);
        background-color: rgba(255, 180, 0, 0.1);
    }
    100% {
        transform: scale(1);
        background-color: rgba(255, 180, 0, 0);
    }
}

/* Applied class for animation */
.sendo-shipping-updated {
    animation: sendo-highlight 1.5s ease-out forwards !important;
    border-radius: 6px;
}

.sendo-shipping-updated li {
    animation: sendo-pulse 0.5s ease-out !important;
    transform-origin: center !important;
}



/* Success checkmark indicator */
.sendo-update-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.sendo-update-indicator::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.sendo-update-indicator.sendo-show {
    opacity: 1;
    transform: scale(1);
}

/* Price change highlight */
.sendo-price-updated {
    color: #10b981 !important;
    font-weight: 600;
    animation: sendo-price-flash 1s ease-out;
}

@keyframes sendo-price-flash {
    0%, 20% {
        background-color: rgba(16, 185, 129, 0.2);
    }
    100% {
        background-color: transparent;
    }
}



/* ===========================================
   SENDO LOGO UPDATE ANIMATION
   =========================================== */

.sendo-update-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: auto;
    opacity: 40%;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.5s ease-out;
}

.sendo-update-logo.sendo-show {
    opacity: 1;
}

.sendo-update-logo.sendo-fade-out {
    opacity: 0 !important;
}

.sendo-update-logo svg {
    width: 100%;
    height: auto;
    display: block;
    transform: perspective(1000px) rotateY(0deg) !important;
}

.sendo-update-logo.sendo-spin svg {
    transform: perspective(1000px) rotateY(360deg) !important;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
