/**
 * Easyship Product Form Styles
 * Styles for enhanced delivery fields and shipping calculation
 */

/* Force courier section visibility */
#courier-selection-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#courier-options-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#courier-options-list {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Package Dimensions Grid */
.lpm-package-dimensions {
    margin-bottom: 20px;
}

.lpm-dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.lpm-dimension-field {
    display: flex;
    flex-direction: column;
}

.lpm-dimension-field label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.lpm-dimension-input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.lpm-dimension-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Shipping Payer Options */
.lpm-shipping-payer-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.lpm-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lpm-radio-label:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.lpm-radio-label input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.lpm-radio-label input[type="radio"]:checked + .lpm-radio-label {
    border-color: #007cba;
    background-color: #e8f4f7;
}

/* Calculate Shipping Button */
.lpm-calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lpm-calculate-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
}

.lpm-calculate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.lpm-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lpm-calculate-btn .spinner {
    display: none;
    width: 16px;
    height: 16px;
}

.lpm-calculate-btn.calculating .spinner {
    display: inline-block;
}

/* Enhanced Price Field */
.lpm-price-field {
    display: flex;
    align-items: center;
    position: relative;
}

.lpm-price-field .currency-symbol {
    position: absolute;
    left: 12px;
    font-weight: 600;
    color: #666;
    z-index: 2;
}

.lpm-price-field input[readonly] {
    padding-left: 35px;
    background-color: #f8f9fa;
    border-color: #e1e5e9;
    color: #666;
}

/* Rate Details Display */
.lpm-rate-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    display: none;
}

.lmp-rate-summary h4 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 16px;
}

.lmp-rate-summary p {
    margin: 5px 0;
    font-size: 14px;
}

.lmp-alternative-rates {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.lmp-alternative-rates h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.lmp-alternative-rates ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lmp-alternative-rates li {
    padding: 5px 0;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.lmp-alternative-rates li:last-child {
    border-bottom: none;
}

/* Messages */
.lmp-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}

.lmp-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lmp-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.lmp-message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.lmp-message-info {
    background: #cce7f0;
    color: #004085;
    border: 1px solid #b6d7ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lpm-dimensions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .lpm-shipping-payer-options {
        gap: 8px;
    }
    
    .lpm-radio-label {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .lpm-calculate-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .lpm-price-field {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .lpm-dimensions-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Field Enhancements */
.lpm-form-field.lpm-package-dimensions label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.lpm-form-field .description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.lpm-calculate-btn:disabled {
    animation: pulse 1.5s infinite;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shipping Payer Inline Layout */
.lpm-shipping-payer {
    margin-bottom: 15px;
}

.lpm-shipping-payer > div {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.lpm-shipping-payer label {
    font-weight: 600;
    color: #1565c0;
    margin: 0;
    white-space: nowrap;
}

.lpm-shipping-payer .radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: center;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.lpm-shipping-payer .radio-option {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 14px;
}

.lpm-shipping-payer .radio-option:hover {
    border-color: #007cba !important;
    background-color: #f8f9fa !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.lpm-shipping-payer .radio-option input[type="radio"] {
    margin-right: 8px;
}

.lpm-shipping-payer .radio-option input[type="radio"]:checked + span {
    color: #007cba !important;
    font-weight: 600;
}

/* Courier Options Styling */
.courier-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.courier-option:hover {
    border-color: #007cba !important;
    background-color: #f8f9fa !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.courier-option.selected {
    border-color: #007cba !important;
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.courier-option input[type="radio"]:checked + label {
    color: #007cba !important;
}

/* View More Button */
#view-more-couriers {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#view-more-couriers:hover {
    background-color: #005a87 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

/* Checkbox Labels */
.lpm-checkbox-label.shipping:hover {
    border-color: #007cba !important;
    background-color: #f8f9fa !important;
}

.lpm-checkbox-label.shipping input:checked + .checkmark {
    color: #007cba !important;
}

/* Form Inputs */
.lpm-modern-input:focus,
.lpm-modern-select:focus {
    border-color: #007cba !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Calculate Button */
.lpm-calculate-btn:hover {
    background-color: #1565c0 !important;
}
