.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-height: 500px;

}

.gallery img {
    width: 100%;
    height: auto;
    margin-bottom: 4px;
    border: 1px solid #ddd;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.gallery-item {
    position: relative;
    display: inline-block;
    text-align: center;
}

.gallery-item button {
    display: none;
    position: absolute;
    bottom: 5px;
    /* New styles for thumbnail buttons */
    .thumbnail-item {
        position: relative;
        overflow: hidden;
    }
    left: 50%;
    transform: translateX(-50%);
}

.gallery-item:hover button {
    display: block;
}

.sortable-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    height: 150px;
    width: 480px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .gallery {
        flex-direction: column;
        align-items: center;
    }
}

.category-tree ul {
    list-style-type: none;
    padding-left: 20px;
}
.category-tree label {
    cursor: pointer;
}
.nested-categories {
    transition: all 0.3s ease;
}
.toggle-icon {
    font-weight: bold;
    font-size: 1.2em;
    color: #666;
}
.category-item {
    margin-bottom: 2px;
}
.list-group-item:hover {
    background-color: #f8f9fa;
}

.cats .list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.cats .list-group-item.active .toggle-icon {
    color: white;
}
.loading-spinner {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pagination {
    justify-content: center;
}
.badge {
    text-transform: capitalize;
    font-size: 0.75rem;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.card-title {
    font-size: 1rem;
}
.card-img-top {
    padding: 1rem;
}

.filter-item select {
        width: 100%;
    }
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    .form-select:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .material-icons {
        font-size: 18px;
        vertical-align: text-bottom;
    }

    .list-group-item {
        cursor: grab;
    }

    .list-group-item:active {
        cursor: grabbing;
    }

    .nested-list {
        margin-left: 20px;
    }

    .sortable-ghost {
        opacity: 0.5;
        background: #f8f9fa;
    }
    
    .sortable-chosen {
        background: #fff;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    
    .category-name {
        cursor: move !important;
    }

    /* Update gallery styles */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.main-image-container {
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Update thumbnails-strip styles */
.thumbnails-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden; /* Prevent vertical scroll */
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    height: 120px; /* Fixed height */
}

.thumbnail-item {
    position: relative;
    min-width: 100px;
    height: 100px;
    cursor: move;
    border: 2px solid transparent;
    padding: 2px;
    background: white;
    overflow: hidden;
}

.thumbnail-item.active {
    border-color: var(--primary-color);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.delete-button {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.thumbnail-item:hover .delete-button {
    opacity: 1;
}

.thumbnail-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 20;
}

.thumbnail-item:hover .thumbnail-buttons {
    opacity: 1;
}

.image-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-detail-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-detail-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.image-detail-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.image-detail-modal .modal-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2030;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.image-detail-modal .btn-group {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

.image-detail-modal .btn {
    color: white;
    border: none;
    background: transparent;
}

.image-detail-modal .btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-detail-modal .image-container {
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
}

.image-detail-modal .cropper-container {
    max-width: 90vw;
    max-height: 90vh;
}

.calendar-controls {
    margin-bottom: 20px;
  }
  .calendar-controls select {
    padding: 5px;
    margin-right: 10px;
  }
  table {
    width: 100%;
    border-collapse: collapse;
  }
  th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: top;
  }
  th {
    background-color: #f2f2f2;
  }
  .day-number {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
    display: block;
  }
  .not-in-month {
    background-color: rgba(0, 0, 0, 0.05);
    color: #adb5bd;
  }
  .task-item {
    padding: 3px 5px;
    margin: 2px 0;
    font-size: 0.9em;
    background-color: var(--bs-primary-bg-subtle);
    border-radius: var(--bs-border-radius-sm);
    color: var(--bs-primary);
  }
  .calendar-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .calendar-table th {
    background-color: var(--bs-primary);
    color: white;
    font-weight: normal;
  }
  .calendar-table td, .calendar-table th {
    border: 1px solid var(--bs-border-color);
  }

  /* Popover styling */
.popover {
    max-width: 900px !important; /* Override Bootstrap's default width */
    width: max-content;          /* Allow content to determine width */
    font-size: 14px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.popover-body {
    padding: 20px;
    line-height: 1.6;
    max-height: 80vh;           /* Prevent too tall popovers */
    overflow-y: auto;           /* Add scroll if content is too long */
}

.popover-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.popover-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popover-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 15px;
}

.popover-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 20px;
    font-weight: 600;
}

/* Style lists inside popovers */
.popover-body ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.popover-body li {
    margin-bottom: 5px;
}

/* Chat window styling aligned with project style */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 800px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

.chat-header {
    background-color: var(--bs-primary);
    color: white;
    padding: 15px;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
}

.message {
    padding: 10px 15px;
    border-radius: 0;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-message {
    align-self: flex-end;
    background-color: var(--bs-primary);
    color: white;
}

.assistant-message {
    align-self: flex-start;
    background-color: white;
    border: 1px solid var(--bs-border-color);
}

.chat-input {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid var(--bs-border-color);
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--bs-border-color);
    border-radius: 0;
    margin-right: 10px;
}

.chat-input button {
    padding: 10px 20px;
    background-color: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-input button:hover {
    background-color: var(--bs-primary-hover, #0b5ed7);
}

.typing-indicator {
    align-self: flex-start;
    background-color: white;
    padding: 10px 15px;
    border-radius: 0;
    margin-bottom: 10px;
    display: none;
    border: 1px solid var(--bs-border-color);
}

.typing-dots {
    display: inline-block;
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    margin-right: 3px;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.info-list {
    max-width: 800px;
    margin: 2rem auto;
    background-color: white;
    border: 1px solid var(--bs-border-color);
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-list li {
    margin-bottom: 1.5rem;
}

.info-list h4 {
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.error-text {
    color: var(--bs-danger, #dc3545);
}

.tox.tox-tinymce {
    border-radius: 0 !important;
}

/* Styly pro postranní panel */
#category-sidebar {
    transition: width 0.35s ease-in-out, 
                padding-left 0.35s ease-in-out, 
                padding-right 0.35s ease-in-out, 
                opacity 0.3s ease-in-out 0.05s; /* Mírné zpoždění opacity pro lepší vizuální efekt */
    overflow: hidden; /* Zabrání přetékání obsahu během přechodu */
    will-change: width, padding, opacity; /* Nápověda pro optimalizaci prohlížečem */
}

#category-sidebar.collapsed {
    width: 0 !important; /* Přepsání šířky Bootstrap sloupce */
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important; /* Zajistí nulový margin ve skrytém stavu */
    margin-right: 0 !important; /* Zajistí nulový margin ve skrytém stavu */
    opacity: 0;
    border-left: none !important; /* Skryje případný levý okraj */
    border-right: none !important; /* Skryje případný pravý okraj */
}

/* Styly pro nové umístění a vzhled tlačítka pro přepínání postranního panelu */
#main-product-content {
    position: relative; /* Nutné pro absolutní pozicování vnořeného tlačítka */
}

#toggle-sidebar-btn {
    position: absolute;
    top: 20px; /* Vertikální pozice od horního okraje main-product-content */
    left: 0px;   /* Zarovnání k levému okraji main-product-content */
    transform: translateX(-50%); /* Posunutí o polovinu šířky doleva, aby bylo vystředěno na hraně */
    z-index: 1040; /* Zajištění, aby bylo nad ostatními prvky (kromě modálních oken) */
    
    background-color: white;
    border: 1px solid #dee2e6; /* Standardní Bootstrap okraj */
    color: #6c757d; /* Standardní Bootstrap sekundární barva textu */

    width: 40px;  /* Šířka "úchytu" */
    height: 60px; /* Výška "úchytu" */
    padding: 0;   /* Odebrání defaultního paddingu tlačítka */
    
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1); /* Jemný stín pro 3D efekt */
    cursor: pointer;
    
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#toggle-sidebar-btn:hover {
    background-color: #f8f9fa; /* Lehké zvýraznění při najetí myší */
    box-shadow: 3px 0px 7px rgba(0, 0, 0, 0.15);
    color: #545b62;
}

#toggle-sidebar-btn i {
    font-size: 1rem; /* Velikost ikony */
    line-height: 1;  /* Zajistí správné vertikální zarovnání ikony */
}

/* Modal XXL - Extra široký modal */
@media (min-width: 1400px) {
    .modal-xxl {
        --bs-modal-width: 90%;
        max-width: 1400px;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .modal-xxl {
        --bs-modal-width: 1140px;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .modal-xxl {
        --bs-modal-width: 900px;
    }
}
}