/* Delivery Zones Admin Interface */
.delivery-zones-admin {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.delivery-zones-admin h1 {
    margin-bottom: 20px;
    color: #333;
}

/* Zone Settings Meta Box */
.delivery-zone-settings .form-table {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.delivery-zone-settings .form-table th {
    font-weight: 600;
    color: #333;
    width: 200px;
}

.delivery-zone-settings .form-table td {
    padding: 10px 0;
}

/* Delivery Days Checkboxes */
.delivery-days-fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.delivery-days-fieldset label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #555;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.delivery-days-fieldset label:hover {
    background: #e0e0e0;
}

.delivery-days-fieldset input[type="checkbox"] {
    margin-right: 8px;
}

.delivery-days-fieldset input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #007cba;
}

/* Zone Rules */
.delivery-zone-rules {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
}

.delivery-zone-rules .form-table input[type="number"] {
    width: 100px;
}

.delivery-zone-rules .form-table input[type="checkbox"] {
    transform: scale(1.2);
}

/* Coverage Areas */
.delivery-zone-coverage textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.delivery-zone-coverage .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* Customer Assignment Table */
.customer-assignments-table {
    margin-top: 20px;
    border-collapse: collapse;
    width: 100%;
}

.customer-assignments-table th,
.customer-assignments-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.customer-assignments-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.customer-assignments-table tr:hover {
    background: #f8f9fa;
}

.customer-assignments-table .customer-address {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-assignments-table .zone-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Bulk Actions */
.bulk-actions {
    background: #f0f8ff;
    border: 1px solid #b0d4f1;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.bulk-actions h3 {
    margin-top: 0;
    color: #0073aa;
}

.bulk-actions .form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-actions select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bulk-actions button {
    background: #0073aa;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.bulk-actions button:hover {
    background: #005a87;
}

/* Frontend Delivery Information */
.delivery-info-widget {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.delivery-info-widget h3 {
    margin-top: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delivery-info-widget .delivery-zone-name {
    font-weight: 600;
    color: #007cba;
}

.delivery-info-widget .delivery-details {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.delivery-info-widget .delivery-details dt {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.delivery-info-widget .delivery-details dd {
    margin-bottom: 10px;
    color: #666;
}

/* Delivery Date Selector */
.delivery-date-selector {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.delivery-date-selector h4 {
    margin-top: 0;
    color: #333;
}

.delivery-date-selector .form-group {
    margin-bottom: 15px;
}

.delivery-date-selector label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.delivery-date-selector input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Delivery Options */
.delivery-options {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.delivery-options h4 {
    margin-top: 0;
    color: #333;
}

.delivery-options .option {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.delivery-options .option label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.delivery-options .option input[type="radio"] {
    margin-right: 10px;
}

.delivery-options .option-description {
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

/* Delivery Messages */
.delivery-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.delivery-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.delivery-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.delivery-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Schedule Preview */
.schedule-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    display: none;
}

.schedule-preview h4 {
    margin-top: 0;
    color: #333;
}

.schedule-preview p {
    margin-bottom: 8px;
    color: #555;
}

.schedule-preview strong {
    color: #333;
}

/* Preview Button */
.preview-button {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.preview-button:hover {
    background: #218838;
    color: white;
}

/* Status Indicators */
.zone-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.zone-status.active {
    background: #d4edda;
    color: #155724;
}

.zone-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .delivery-zones-admin {
        padding: 15px;
    }
    
    .delivery-days-fieldset {
        flex-direction: column;
        gap: 10px;
    }
    
    .bulk-actions .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .customer-assignments-table {
        font-size: 14px;
    }
    
    .customer-assignments-table th,
    .customer-assignments-table td {
        padding: 8px;
    }
    
    .customer-assignments-table .customer-address {
        max-width: 150px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.delivery-days-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.delivery-days-error::before {
    content: "⚠ ";
}

/* Success States */
.delivery-success {
    color: #28a745;
    font-size: 14px;
    margin-top: 5px;
}

.delivery-success::before {
    content: "✓ ";
}

/* Tooltips */
.tooltip-trigger {
    position: relative;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* WooCommerce Integration */
.woocommerce-checkout .delivery-info-widget {
    margin-bottom: 20px;
}

.woocommerce-checkout .delivery-date-selector {
    margin-bottom: 20px;
}

.woocommerce-checkout .delivery-options {
    margin-bottom: 20px;
} 