.yml-constructor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.yml-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.yml-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.yml-form-group {
    margin-bottom: 15px;
}

.yml-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.yml-form-group input[type="text"],
.yml-form-group input[type="url"],
.yml-form-group input[type="number"],
.yml-form-group select,
.yml-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.yml-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.yml-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

.btn:hover {
    background: #005a87;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-secondary:hover {
    background: #545b62;
}

.fields-group {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.fields-group h4 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.char-counter.warning {
    color: #ff9800;
}

.char-counter.error {
    color: #f44336;
}

.picture-field {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.picture-field input {
    flex: 1;
}

.remove-picture {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 3px;
    width: 30px;
    cursor: pointer;
    font-size: 30px;
    padding: 0;
    height: 30px;
    margin-top: 10px;
}

.remove-picture:hover {
    background: #b22222;
}

.param-field {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.param-field .yml-form-row {
    gap: 10px;
}
.param-field .yml-form-row {
    display: flex;
    align-items: center;
}
.param-field .yml-form-row .yml-form-group {
    flex: 1;
}
.remove-param {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 3px;
    width: 30px;
    cursor: pointer;
    font-size: 30px;
    padding: 0;
    height: 30px;
    margin-top: -5px;
}
.category-item, .offer-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.category-item:hover, .offer-item:hover {
    border-color: #0073aa;
    position: relative;
}
.category-item:before, .offer-item:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 100%;
    background: #0073aa;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 2px 0 0 2px;
    opacity: 0;
    transition: opacity 0.3s
    ease;
}
.category-item:hover:before, .offer-item:hover:before {
    opacity: 1;
}
.remove-category, .remove-offer {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.remove-category:hover, .remove-offer:hover {
    background: #b22222;
}

#categories-list, #offers-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

#message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

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

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

.actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.category-edit-form,
.offer-edit-form {
    border-left: 3px solid #0073aa;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-info {
    flex: 1;
}

.item-info small {
    color: #666;
    font-size: 12px;
}

.no-items {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-secondary:hover {
    background: #545b62;
}


/* Стили для конструктора коллекций */
.collections-container {
    margin-top: 20px;
}
.collection-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: margin-left 0.3s ease;
}

.collection-item:hover {
    border-color: #0073aa;
}

.collection-info {
    flex: 1;
    overflow-x: scroll;
}

.collection-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.collection-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.collection-info p strong {
    color: #333;
}

.collection-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.no-collections {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Индикатор уровня вложенности */
.collection-item {
    position: relative;
}

.collection-item::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 100%;
    background: #0073aa;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 2px 0 0 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.collection-item:hover::before {
    opacity: 1;
}

/* Стили для уведомлений в правом нижнем углу */
.yml-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.yml-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.yml-notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

.yml-notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.yml-notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.yml-notification.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
}

.yml-notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
}

.yml-notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.yml-notification-content {
    flex: 1;
}

.yml-notification-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.yml-notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .yml-notification {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none;
        transform: translateY(100px);
    }

    .yml-notification.show {
        transform: translateY(0);
    }

    .yml-notification.hide {
        transform: translateY(100px);
    }
}

/* Стили для блока загрузки */
.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0073aa;
    background: #f0f7ff;
}

.upload-area.dragover {
    border-color: #0073aa;
    background: #e6f3ff;
}

.upload-content .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-content h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.upload-content p {
    margin: 5px 0;
    color: #666;
}

.upload-info {
    font-size: 12px;
    color: #999;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.file-info.success {
    border-left-color: #28a745;
}

.file-info.error {
    border-left-color: #dc3545;
}

/* Стили для модального окна подтверждения */
.yml-confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.yml-modal-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.yml-modal-header {
    padding: 20px 20px 0;
    border-bottom: 1px solid #eee;
}

.yml-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.yml-modal-body {
    padding: 20px;
}

.yml-modal-body p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.yml-modal-footer {
    padding: 15px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
}

/* Стили для кнопки с загруженными данными */
#toggle-upload.has-data {
    background: #28a745;
    border-color: #28a745;
}
.toggle-upload-label{
    display: none;
}
.toggle-upload-label.show{
    display: inline;
}
#toggle-upload.has-data:hover {
    background: #218838;
    border-color: #1e7e34;
}

.upload-badge {
    display: inline-block;
    background: white;
    color: #28a745;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

/* Анимация для модального окна */
.yml-confirmation-modal {
    animation: fadeIn 0.3s ease;
}

.yml-modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Стили для кнопок действий */
.item-actions,
.collection-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-secondary.edit-offer,
.btn-secondary.edit-collection {
    background: #17a2b8;
}

.btn-secondary.edit-offer:hover,
.btn-secondary.edit-collection:hover {
    background: #138496;
}

.btn-secondary.duplicate-offer,
.btn-secondary.duplicate-collection {
    background: #28a745;
}

.btn-secondary.duplicate-offer:hover,
.btn-secondary.duplicate-collection:hover {
    background: #218838;
}

.btn-secondary.remove-offer,
.btn-secondary.remove-collection {
    background: #dc3545;
}

.btn-secondary.remove-offer:hover,
.btn-secondary.remove-collection:hover {
    background: #c82333;
}

/* Индикатор копии */
.copy-indicator {
    font-size: 10px;
    color: #28a745;
    margin-left: 5px;
    font-weight: normal;
}