.tribest-configurator {
    margin: 0 auto;
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.load-config-section, .title-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.load-config-section label, .title-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#saved-configs, #config-title {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#load-config {
    padding: 6px 12px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
	font-size: 14px;
}

#load-config:hover {
    background-color: #005a87;
}

/* Стилове за drag and drop */
.tables-container.ui-sortable {
    min-height: 100px;
    position: relative;
}

.product-table.ui-sortable-helper {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

.product-table.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    height: 100px;
}

.product-table.dragging {
    opacity: 0.7;
}

.product-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-group {
    flex: 1;
    min-width: 300px;
}

.product-group select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#add-product-pair, #save-config {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
	font-size: 14px;
}

#add-product-pair:hover, #save-config:hover {
    background-color: #45a049;
}

#export-pdf {
	padding: 6px 12px;
	font-size: 14px;
	border-radius: 4px;
}

.tables-container {
    min-height: 100px;
    margin-bottom: 20px;
}

.product-table {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: move;
}

.delete-table {
    position: absolute;
    top: 0px;
    right: 5px;
    cursor: pointer;
    font-size: 20px;
    color: #ff0000;
}

.trb-product-table {
	display: grid;
	grid-template-rows: auto auto auto;
	gap: 5px;
}

.trb-product-table .trb-product-table-tr {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0px;
}

.trb-product-table .trb-product-table-tr.row-1 {
	justify-items: stretch
}

.trb-product-table .trb-product-table-tr.row-2 {
	grid-template-columns: 0.35fr 3.65fr 0.4fr 0.6fr 0.6fr 0.4fr;
}

.trb-product-table .trb-product-table-tr.trb-repeat {
	position: relative;
	grid-template-columns: 0.35fr 3.65fr 0.4fr 0.6fr 0.6fr 0.4fr;
}

.trb-product-table .trb-product-table-tr .big-1 {
	grid-column: 1 / 5;
}

.trb-product-table .trb-product-table-tr .big-2 {
	grid-column: 5 / 7;
}

.trb-product-table .trb-product-table-td {
  border: 1px solid #333;
  padding: 2px;
  text-align: center;
  background: #f9f9f9;
  margin: 0px 1px;
}

.trb-product-table-td.trb-head-td {
  text-align: left;
  padding-left: 8px;
}

.trb-product-table-tr.row-1 .trb-product-table-td {
  background: #252525;
  color: #fff;
}

.trb-product-table-tr.row-2 .trb-product-table-td {
  background: #ddd;
}

#clear-config,
#update-config,
#delete-config {
    padding: 6px 12px;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
	font-size: 14px;
}

#clear-config {
    background-color: #ff9800;
    color: white;
}

#clear-config:hover {
    background-color: #e68900;
}

#update-config {
    background-color: #2196f3;
    color: white;
}

#update-config:hover {
    background-color: #0b7dda;
}

#delete-config {
    background-color: #f44336;
    color: white;
}

#delete-config:hover {
    background-color: #da190b;
}

/* Стилове за модален прозорец за потвърждение */
#confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}

#confirm-modal > div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    min-width: 300px;
    max-width: 500px;
}

#confirm-modal p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

#confirm-cancel {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

#confirm-cancel:hover {
    background-color: #5a6268;
}

#confirm-ok {
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#confirm-ok:hover {
    background-color: #c82333;
}

#error-modal,
#success-modal,
#no-products-modal,
#no-title-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}

#error-modal > div,
#success-modal > div,
#no-products-modal > div,
#no-title-modal > div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    min-width: 300px;
    max-width: 500px;
}

#error-modal h3,
#success-modal h3,
#no-products-modal h3,
#no-title-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

#error-modal h3 {
    color: #d9534f;
}

#success-modal h3 {
    color: #28a745;
}

#no-products-modal h3,
#no-title-modal h3 {
    color: #d9534f;
}

.modal-close {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-close:hover {
    background-color: #005a87;
}

@media (max-width: 768px) {
    .product-selection {
        flex-direction: column;
    }
    
    .product-group {
        min-width: 100%;
    }
}