/**
 * DZ Shipping Manager Styles
 * تنسيقات إضافة إدارة الشحن الجزائري
 */

/* تنسيقات الأزرار */
button, .button, .woocommerce button.button {
    background-color: #1346af !important;
    border-color: #1346af !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

button:hover, .button:hover, .woocommerce button.button:hover {
    background-color: #0f3a9a !important;
    border-color: #0f3a9a !important;
    transform: translateY(-1px);
}

/* تنسيقات الحقول */
select, input {
    border-radius: 8px !important;
    border: 2px solid #e1e5e9 !important;
    transition: border-color 0.3s ease;
}

select:focus, input:focus {
    border-color: #1346af !important;
    box-shadow: 0 0 0 3px rgba(19, 70, 175, 0.1) !important;
    outline: none !important;
}

/* تنسيقات صفحة الإدارة */
.dz-shipping-header {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1346af;
}

.dz-shipping-header .button-primary {
    font-size: 16px;
    padding: 10px 20px;
}

/* تنسيقات الجداول */
.wp-list-table th {
    background-color: #1346af;
    color: white;
    font-weight: bold;
    text-align: right;
}

.wp-list-table td {
    vertical-align: middle;
}

.status-active {
    color: #00a32a;
    font-weight: bold;
}

.status-inactive {
    color: #d63638;
    font-weight: bold;
}

/* تنسيقات المودال */
.dz-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dz-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dz-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.dz-close:hover {
    color: #1346af;
}

/* تنسيقات صفحة الدفع */
.woocommerce-checkout #billing_state,
.woocommerce-checkout #billing_city {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    margin-bottom: 15px;
}

.woocommerce-checkout #billing_state:disabled,
.woocommerce-checkout #billing_city:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* رسائل الخطأ */
.woocommerce-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.woocommerce-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* تنسيقات الاستجابة */
@media (max-width: 768px) {
    .dz-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .wp-list-table {
        font-size: 14px;
    }
    
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px;
    }
    
    .woocommerce-checkout #billing_state,
    .woocommerce-checkout #billing_city {
        font-size: 16px; /* منع التكبير في iOS */
    }
}

/* تنسيقات RTL */
.rtl .wp-list-table th,
.rtl .wp-list-table td {
    text-align: right;
}

.rtl .form-table th {
    text-align: right;
}

/* تأثيرات التحميل */
.dz-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.dz-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1346af;
    border-radius: 50%;
    animation: dz-spin 1s linear infinite;
}

@keyframes dz-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تنسيقات إضافية للواجهة */
.notice {
    border-radius: 8px;
    border-left-width: 4px;
}

.notice-success {
    border-left-color: #00a32a;
}

.notice-error {
    border-left-color: #d63638;
}

.notice-info {
    border-left-color: #1346af;
}

/* تنسيقات الحقول المتعددة الاختيار */
select[multiple] {
    height: 120px;
    padding: 10px;
}

select[multiple] option {
    padding: 5px;
    margin: 2px 0;
}

/* تنسيقات النماذج */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    font-weight: 600;
}

.form-table td {
    padding: 15px 10px;
}

/* تنسيقات الأيقونات */
.dashicons-location:before {
    color: #1346af;
}

/* تنسيقات صفحة إضافة شركة التوصيل الجديدة */
.dz-shipping-settings {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dz-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.dz-default-delivery h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
}

.dz-delivery-options {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.dz-delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.dz-delivery-option:hover {
    border-color: #1346af;
    background: #f8f9ff;
}

.dz-delivery-option input[type="radio"]:checked + span {
    color: #1346af;
    font-weight: 600;
}

.dz-delivery-option input[type="radio"]:checked ~ * {
    border-color: #1346af;
}

.dz-delivery-option input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #1346af;
}

.dz-global-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-end;
}

.dz-stopdesk-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dz-toggle {
    position: relative;
    display: inline-block;
    width: 55px;
    height: 28px;
    cursor: pointer;
}

.dz-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dz-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.dz-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dz-toggle input:checked + .dz-toggle-slider {
    background-color: #1346af;
}

.dz-toggle input:checked + .dz-toggle-slider:before {
    transform: translateX(27px);
}

.dz-small-toggle {
    width: 45px;
    height: 22px;
}

.dz-small-toggle .dz-toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
}

.dz-small-toggle input:checked + .dz-toggle-slider:before {
    transform: translateX(23px);
}

.dz-toggle-label {
    font-weight: bold;
    color: #23282d;
    font-size: 14px;
}

.dz-label-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dz-label-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dz-label-field label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dz-label-field input {
    width: 220px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.dz-label-field input:focus {
    border-color: #1346af;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 70, 175, 0.1);
}

.dz-company-info {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dz-pricing-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dz-pricing-section h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #23282d;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #1346af;
    padding-bottom: 10px;
}

.dz-pricing-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.dz-pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
}

.dz-pricing-table th,
.dz-pricing-table td {
    padding: 15px 12px;
    text-align: right;
    border-bottom: 1px solid #e1e5e9;
}

.dz-pricing-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #23282d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dz-pricing-table tbody tr:hover {
    background-color: #f8f9ff;
}

.dz-pricing-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.dz-pricing-table tbody tr:nth-child(even):hover {
    background-color: #f0f4ff;
}

.dz-state-name {
    min-width: 160px;
    font-weight: bold;
    color: #23282d;
    font-size: 14px;
}

.dz-price-input {
    width: 120px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dz-price-input:focus {
    border-color: #1346af;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 70, 175, 0.1);
}

.dz-office-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.dz-stopdesk-toggle {
    text-align: center;
}

#dz-submit-btn {
    margin-top: 25px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    background: #1346af;
    border-color: #1346af;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#dz-submit-btn:hover {
    background: #0f3a9a;
    border-color: #0f3a9a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(19, 70, 175, 0.3);
}

/* تنسيقات الاستجابة للصفحة الجديدة */
@media (max-width: 1024px) {
    .dz-settings-header {
        flex-direction: column;
        gap: 25px;
    }
    
    .dz-global-settings {
        align-items: flex-start;
        flex-direction: row;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .dz-shipping-settings,
    .dz-company-info,
    .dz-pricing-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .dz-delivery-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .dz-label-field input {
        width: 100%;
        max-width: 300px;
    }
    
    .dz-pricing-table th,
    .dz-pricing-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .dz-price-input {
        width: 100px;
        padding: 6px 8px;
    }
    
    .dz-state-name {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .dz-pricing-table-container {
        font-size: 12px;
    }
    
    .dz-price-input {
        width: 80px;
        padding: 4px 6px;
    }
    
    .dz-toggle {
        width: 45px;
        height: 22px;
    }
    
    .dz-small-toggle {
        width: 35px;
        height: 18px;
    }
}
