#similarProgramsTable {
    margin-bottom: 0;
    font-size: 15px;
}

#similarProgramsTable th {
    background-color: #f5f5f5;
    font-weight: bold;
    vertical-align: middle;
    padding: 8px 12px;
    text-align: center;
}

#similarProgramsTable td {
    vertical-align: middle;
    padding: 8px 12px;
}

/* Center align specific columns */
#similarProgramsTable td:first-child,
#similarProgramsTable td:nth-child(4),
#similarProgramsTable td:nth-child(5),
#similarProgramsTable td:last-child {
    text-align: center;
}

.edit-btn, .delete-btn {
    margin: 2px;
    padding: 6px 10px;
    font-size: 16px;
    background: transparent !important;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn {
    color: #000000 !important;
}

.delete-btn {
    color: #d9534f !important;
}

#similarProgramForm .form-group {
    margin-bottom: 20px;
}

#similarProgramForm label {
    font-weight: bold;
    margin-bottom: 8px;
}

#titles, #channelIds {
    font-family: monospace;
}

.three-quarters {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 5px solid #3498db;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.label {
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 8px;
}

.label-danger { background-color: #d9534f; }
.label-warning { background-color: #f0ad4e; }
.label-info { background-color: #5bc0de; }
.label-primary { background-color: #337ab7; }
.label-default { background-color: #777; }

#similarProgramsTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#similarProgramsTable tbody tr:hover {
    background-color: #f5f5f5;
}

#similarProgramsTable tbody tr.highlight {
    background-color: #d9edf7;
}

/* Image upload specific styles */
.image-upload-item {
    transition: background-color 0.2s;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.image-upload-item:hover {
    background-color: #f5f5f5;
}

.image-upload-item[data-existing="true"] {
    background-color: #f9f9f9;
    border-left: 3px solid #5cb85c;
}

.image-preview {
    border-radius: 4px;
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    padding: 5px;
}

.image-info {
    color: #666;
    font-size: 12px;
    margin-left: 10px;
}

#imagesWrapper {
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

#imagesWrapper::-webkit-scrollbar {
    width: 8px;
}

#imagesWrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#imagesWrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#imagesWrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Grid layout for images in modal */
#imagesWrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1em;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.image-upload-item {
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.image-upload-item:hover {
    background-color: #f5f5f5;
}

.image-upload-item[data-existing="true"] {
    background-color: #f9f9f9;
    border-left: 3px solid #5cb85c;
}

.image-preview {
    max-width: 150px;
    max-height: 100px;
    border: 1px solid #ddd;
    padding: 5px;
    margin-bottom: 5px;
}

.image-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.remove-image-btn {
    font-size: 12px;
    padding: 4px 8px;
}

/* Remove the old image type selector styles since we don't need them anymore */
.image-type {
    display: none !important;
}

#addImageBtn {
    margin-bottom: 15px;
}

.remove-image-btn {
    font-size: 13px;
}

/* Images in table styling */
#similarProgramsTable td:nth-child(5) {
    text-align: center;
}

#similarProgramsTable td:nth-child(5) img {
    height: 30px;
    width: 30px;
    padding: 2px;
    margin: 1px;
    border-radius: 3px;
    display: inline-block;
}

/* Make sure the images column has enough width */
#similarProgramsTable th:nth-child(5),
#similarProgramsTable td:nth-child(5) {
    min-width: 100px;
    max-width: 150px;
}

/* Action buttons center alignment */
.action-buttons {
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 768px) {
    .edit-btn, .delete-btn {
        padding: 4px 8px;
        font-size: 14px;
    }

    #similarProgramsTable {
        font-size: 13px;
    }

    #similarProgramsTable th,
    #similarProgramsTable td {
        padding: 6px 8px;
    }

    .image-upload-item .col-sm-3,
    .image-upload-item .col-sm-6 {
        width: 100%;
        margin-bottom: 10px;
    }

    .image-preview {
        max-width: 100%;
    }

    #similarProgramsTable td:nth-child(5) img {
        height: 25px;
        width: 25px;
    }
}

.modal-lg {
    max-width: 800px;
}

.text-muted {
    font-size: 13px;
}

.alert {
    margin-bottom: 20px;
}

.alert i {
    margin-right: 10px;
}

small {
    font-size: 12px;
}

.panel-heading .btn {
    margin-left: 10px;
}

.form-control:invalid {
    border-color: #d9534f;
}

.form-control:valid {
    border-color: #5cb85c;
}

.date-cell {
    font-size: 12px;
}

.btn.edit-btn, .btn.delete-btn {
    background-color: transparent !important;
    background-image: none !important;
    filter: none !important;
}

/* Empty state for images */
#imagesWrapper:empty::before {
    content: "Нема додадени слики. Кликнете на 'Додади слика' за да додадете.";
    display: block;
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}