@font-face {
    font-family: 'Vazirmatn';
    src: url('meta/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif; 
    background-color: #f4f6f9; 
    color: #333; 
    margin: 0; 
    padding: 15px; 
    direction: rtl;
    font-size: 14px;
    line-height: 1.6;
}
.container { 
    max-width: 700px; 
    margin: 0 auto; 
    background-color: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}
h1 { 
    text-align: center; 
    color: #2c3e50; 
    margin-bottom: 25px; 
    font-size: 24px;
}
.form-group { margin-bottom: 20px;}
.form-row { display: flex; gap: 20px; align-items: flex-end; }
.form-row .form-group { flex: 1;}
.featured-checkbox { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.featured-checkbox label { margin-bottom: 0; }
label {display: block; margin-bottom: 8px; font-weight: 600; }
input[type="text"], input[type="number"], textarea, select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; background: #fff; }
.input-with-button { display: flex;}
.input-with-button input { flex-grow: 1; border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-with-button button, .upload-btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.action-buttons { display: flex; gap: 15px;}
.add-attribute-btn {background-color: #ff9800; width: auto; margin-bottom: 20px; }
.add-variation-btn { background-color: #28a745; width: auto; margin-bottom: 20px; }
.attribute-box { background-color: #f5f5f5; padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 2px solid #ddd; position: relative; }
.attribute-box.variation-box { border-color: #28a745; }
.attribute-box.regular-attribute-box { border-color: #ff9800; }
.attribute-box .form-group { margin-bottom: 15px; }
.remove-attribute-btn { position: absolute; top: 10px; left: 10px; background: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.attribute-type-label { position: absolute; top: 10px; right: 10px; background: #007bff; color: white; padding: 5px 15px; border-radius: 15px; font-size: 12px; font-weight: bold; }
.attribute-type-label.variation-type { background: #28a745; }
.attribute-type-label.regular-type { background: #ff9800; }
.tag { background-color: #3498db; color: white; padding: 5px 10px; border-radius: 15px; font-size: 14px; display: flex; align-items: center; }
.remove-tag { background: none; border: none; color: white; margin-right: 5px; cursor: pointer; font-weight: bold; }
button { background-color: #28a745; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; width: 100%; transition: background-color 0.2s; }
button:disabled { background-color: #aaa; cursor: not-allowed; }
button[type="button"] { background-color: #007bff; width: auto; }
.hidden { display: none !important; }
.upload-area { border: 2px dashed #ccc; border-radius: 8px; padding: 20px; text-align: center; cursor: pointer; min-height: 150px; display: flex; justify-content: center; align-items: center; position: relative; }
.upload-area img { max-width: 100%; max-height: 150px; border-radius: 4px; }
.upload-area span { color: #888; }
.gallery-preview { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-preview img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }

/* Responsive Design */
@media (max-width: 768px) {
    body { padding: 10px; }
    
    .container { 
        padding: 15px; 
        margin: 0;
    }
    
    h1 { 
        font-size: 20px; 
        margin-bottom: 20px; 
    }
    
    .form-row { 
        flex-direction: column; 
        gap: 0; 
    }
    
    .form-row .form-group { 
        flex: none; 
    }
    
    .action-buttons { 
        flex-direction: column; 
        gap: 10px; 
    }
    
    .action-buttons button {
        width: 100% !important;
    }
    
    .attribute-box { 
        padding: 12px; 
    }
    
    .attribute-box .form-group { 
        margin-bottom: 12px; 
    }
    
    .remove-attribute-btn { 
        padding: 4px 8px; 
        font-size: 11px; 
    }
    
    .attribute-type-label { 
        padding: 4px 10px; 
        font-size: 11px; 
    }
    
    .input-with-button { 
        flex-direction: column; 
    }
    
    .input-with-button input { 
        border: 1px solid #ddd; 
        border-radius: 4px; 
    }
    
    .input-with-button button { 
        width: 100%; 
        border-radius: 4px; 
        margin-top: 5px; 
    }
    
    button { 
        padding: 10px 15px; 
        font-size: 14px; 
    }
    
    button[type="button"] { 
        width: 100%; 
    }
    
    .modal-content { 
        padding: 20px; 
        width: 95%; 
    }
    
    .upload-area { 
        padding: 15px; 
        min-height: 120px; 
    }
    
    .gallery-preview img { 
        width: 80px; 
        height: 80px; 
    }
}

@media (max-width: 480px) {
    body { 
        padding: 5px; 
        font-size: 13px;
    }
    
    .container { 
        padding: 10px; 
    }
    
    h1 { 
        font-size: 18px; 
    }
    
    .form-group { 
        margin-bottom: 15px; 
    }
    
    input[type="text"], 
    input[type="number"], 
    textarea, 
    select { 
        padding: 8px; 
        font-size: 14px;
    }
    
    .tag { 
        font-size: 12px; 
        padding: 4px 8px; 
    }
}

/* Select2 Styles for RTL and Mobile */
.select2-container {
    width: 100% !important;
    direction: rtl;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 42px;
    padding: 2px 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #3498db;
    border: none;
    border-radius: 15px;
    color: white;
    padding: 3px 10px;
    margin: 2px;
    direction: rtl;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-left: 5px;
    margin-right: 0;
}

.select2-container--default .select2-search--inline .select2-search__field {
    direction: rtl;
    text-align: right;
}

.select2-dropdown {
    direction: rtl;
}

.select2-results__option {
    text-align: right;
    direction: rtl;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: #3498db;
}

/* Mobile Select2 adjustments */
@media (max-width: 768px) {
    .select2-container {
        font-size: 14px;
    }
    
    .select2-container--default .select2-selection--multiple {
        min-height: 38px;
        padding: 1px 6px;
    }
    
    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        font-size: 13px;
        padding: 2px 8px;
        margin: 1px;
    }
}

@media (max-width: 480px) {
    .select2-container {
        font-size: 13px;
    }
    
    .select2-container--default .select2-selection--multiple {
        min-height: 36px;
        padding: 1px 5px;
    }
    
    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .select2-dropdown {
        font-size: 13px;
    }
}

/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; padding: 30px; border-radius: 8px; width: 90%; max-width: 500px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); text-align: center; }
#modal-status-list { list-style: none; padding: 0; margin-top: 20px; text-align: right; }
#modal-status-list .status-item { padding: 8px 0; border-bottom: 1px solid #eee; display: flex; align-items: center; }
#modal-status-list .status-item::before { content: '⏳'; margin-left: 10px; }
#modal-status-list .status-item.success::before { content: '✅'; }
#modal-status-list .status-item.error::before { content: '❌'; }
#modal-result { margin-top: 20px; padding: 15px; border-radius: 5px; }
#modal-result.success { background-color: #e9f7ef; color: #1d6c41; }
#modal-result.error { background-color: #fbe9e9; color: #a92323; }
#modal-result a { color: #0056b3; font-weight: bold; text-decoration: none; }
#modal-close-btn { background-color: #6c757d; margin-top: 20px; }