/* Main styles for the VI Browser application */

.vi-list-item {
    cursor: pointer;
    font-size: 0.9rem;
    padding: 1rem 1rem;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid rgba(0,0,0,.1);
}

.vi-list-item h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #212529;
}

.vi-list-item.expanded h5 {
    font-weight: 700;
    color: #0d6efd;
}

.vi-list-item p {
    font-size: 0.85rem;
}

.vi-list-item small {
    font-size: 0.75rem;
}

.vi-list-item:hover {
    background-color: #f8f9fa;
    z-index: 2;
}

.vi-list-item.active {
    background-color: #e9ecef;
    border-color: #0d6efd;
}

.vi-list-item.expanded {
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    display: none;
}

.vi-list-item.expanded .vi-description {
    display: none;
}

.vi-front-panel, .vi-block-diagram {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

/* Remove borders from images in detail view */
.vi-detail-container .vi-front-panel, 
.vi-detail-container .vi-block-diagram {
    border: none;
}

.no-front-panel, .no-block-diagram {
    padding: 2rem;
    color: #6c757d;
}

.loading-indicator {
    display: none;
    text-align: center;
    padding: 1rem;
}

.loading-indicator.htmx-request {
    display: block;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}

.image-container {
    position: relative;
    min-height: 100px;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.search-results-container {
    overflow-y: auto;
}

.description-text {
    white-space: normal;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Install path styles */
.font-monospace {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-all;
}

.alert-info {
    background-color: #e8f4f8;
    border-color: #d1e7f0;
}

.install-path {
    font-size: 0.8rem;
    color: #6c757d;
    padding: 0.25rem 0;
    border-top: 1px dotted #dee2e6;
    border-bottom: 1px dotted #dee2e6;
    margin-top: -0.5rem;
    overflow-wrap: break-word;
}

/* Connection info styles */
.connection-info {
    font-size: 0.75rem;
    padding: 0.5rem 0;
}

.connection-status-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    opacity: 0.6;
}

/* Override Bootstrap's success color for connection indicator */
.connection-status-indicator.bg-success {
    background-color: #7fd98f !important; /* Lighter green */
}

.connection-info-container {
    border-top: 1px solid #dee2e6;
    margin-top: auto;
    background-color: #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vi-front-panel, .vi-block-diagram {
        max-height: 300px;
    }
}

.vi-description {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    max-height: 4.2em;
    line-height: 1.4em;
    position: relative;
    z-index: 1;
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.vi-details-wrapper {
    background-color: #f8f9fa;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    padding: 1rem;
    position: relative;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: block;
}

.vi-details-wrapper.d-none {
    display: none !important;
}

.vi-details-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: #6c757d;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.vi-details-close:hover {
    color: #343a40;
    background-color: rgba(0,0,0,.05);
}

.vi-name {
    font-weight: 700;
    color: #0d6efd;
    border-bottom: 1px solid rgba(0,0,0,.1);
    padding-bottom: 0.5rem;
}

/* Remove HTMX transition classes */
.htmx-added, .htmx-settling, .htmx-swapping {
    /* No transitions */
}

.vi-result-container {
    position: relative;
}

.vi-result-container.container-expanded {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 0;
}

.vi-result-container:has(.vi-list-item.expanded) {
    margin-bottom: 0;
}

.container-expanded .vi-details-wrapper {
    margin-top: 0;
    border-top-width: 1px;
}

/* Lightbox styles */
#imageLightbox .modal-dialog {
    max-width: 90vw;
    min-height: 80vh;
}

#imageLightbox .modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: 80vh;
}

#imageLightbox .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

#imageLightbox .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#imageLightbox .nav-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0 1rem;
    background-color: #f8f9fa;
}

#imageLightbox .nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 0.75rem 1.5rem;
    margin-right: 0.5rem;
    border-radius: 0.25rem 0.25rem 0 0;
    transition: all 0.2s ease;
}

#imageLightbox .nav-tabs .nav-link:hover {
    color: #495057;
    background-color: rgba(0, 0, 0, 0.05);
}

#imageLightbox .nav-tabs .nav-link.active {
    color: #0d6efd;
    font-weight: 500;
    border-bottom: 2px solid #0d6efd;
    background-color: transparent;
}

#imageLightbox .tab-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    overflow: auto;
}

#imageLightbox .tab-pane {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

#imageLightbox .tab-pane.active {
    display: flex;
    width: 100%;
}

#imageLightbox img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    margin: 0 auto;
}

.vi-front-panel, .vi-block-diagram {
    cursor: zoom-in;
    transition: transform 0.2s;
}

.vi-front-panel:hover, .vi-block-diagram:hover {
    transform: scale(1.02);
}

/* Lightbox navigation controls */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.lightbox-nav-prev {
    left: 10px;
}

.lightbox-nav-next {
    right: 10px;
}

.lightbox-nav button {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: all 0.2s;
}

.lightbox-nav button:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.lightbox-indicator {
    font-size: 0.9rem;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Make navigation more touch-friendly on mobile */
@media (max-width: 768px) {
    .lightbox-nav button {
        width: 36px;
        height: 36px;
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* Category tags - Consolidated styles for all tag components */
.category-tag {
    display: inline-block;
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    margin-bottom: 5px;
    margin-right: 3px;
    font-size: 0.8rem;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
    opacity: 0.95;
}

/* Hover effect for tags - only for inactive tags */
.category-tag:not(.active):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Special hover for active tags - much more subtle */
.category-tag.active:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Color schemes for tags - Using Tailwind CSS color palette with reduced opacity for inactive tags */
.category-tag.category-tag-0, .category-tag-0 {
    background-color: rgba(191, 219, 254, 0.6); /* blue-200 with opacity */
    color: #2563eb; /* blue-600 */
    border-color: rgba(191, 219, 254, 0.6);
}

.category-tag.category-tag-1, .category-tag-1 {
    background-color: rgba(187, 247, 208, 0.6); /* green-200 with opacity */
    color: #16a34a; /* green-600 */
    border-color: rgba(187, 247, 208, 0.6);
}

.category-tag.category-tag-2, .category-tag-2 {
    background-color: rgba(199, 210, 254, 0.6); /* indigo-200 with opacity */
    color: #4f46e5; /* indigo-600 */
    border-color: rgba(199, 210, 254, 0.6);
}

.category-tag.category-tag-3, .category-tag-3 {
    background-color: rgba(221, 214, 254, 0.6); /* violet-200 with opacity */
    color: #7c3aed; /* violet-600 */
    border-color: rgba(221, 214, 254, 0.6);
}

.category-tag.category-tag-4, .category-tag-4 {
    background-color: rgba(165, 243, 252, 0.6); /* cyan-200 with opacity */
    color: #0891b2; /* cyan-600 */
    border-color: rgba(165, 243, 252, 0.6);
}

.category-tag.category-tag-5, .category-tag-5 {
    background-color: rgba(251, 207, 232, 0.6); /* pink-200 with opacity */
    color: #db2777; /* pink-600 */
    border-color: rgba(251, 207, 232, 0.6);
}

.category-tag.category-tag-6, .category-tag-6 {
    background-color: rgba(253, 230, 138, 0.6); /* amber-200 with opacity */
    color: #d97706; /* amber-600 */
    border-color: rgba(253, 230, 138, 0.6);
}

.category-tag.category-tag-7, .category-tag-7 {
    background-color: rgba(216, 180, 254, 0.6); /* purple-200 with opacity */
    color: #9333ea; /* purple-600 */
    border-color: rgba(216, 180, 254, 0.6);
}

.category-tag.category-tag-8, .category-tag-8 {
    background-color: rgba(228, 228, 231, 0.6); /* zinc-200 with opacity */
    color: #52525b; /* zinc-600 */
    border-color: rgba(228, 228, 231, 0.6);
}

.category-tag.category-tag-9, .category-tag-9 {
    background-color: rgba(186, 230, 253, 0.6); /* sky-200 with opacity */
    color: #0284c7; /* sky-600 */
    border-color: rgba(186, 230, 253, 0.6);
}

/* Active state for tags */
.category-tag.active, .category-tag-btn.active {
    font-weight: bold;
    opacity: 1;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    padding-right: 25px;
    padding-left: 15px;
    position: relative;
    border-color: transparent;
}

/* Invert colors for active tags */
.category-tag-0.active {
    background-color: #2563eb; /* blue-600 */
}

.category-tag-1.active {
    background-color: #16a34a; /* green-600 */
}

.category-tag-2.active {
    background-color: #4f46e5; /* indigo-600 */
}

.category-tag-3.active {
    background-color: #7c3aed; /* violet-600 */
}

.category-tag-4.active {
    background-color: #0891b2; /* cyan-600 */
}

.category-tag-5.active {
    background-color: #db2777; /* pink-600 */
}

.category-tag-6.active {
    background-color: #d97706; /* amber-600 */
}

.category-tag-7.active {
    background-color: #9333ea; /* purple-600 */
}

.category-tag-8.active {
    background-color: #52525b; /* zinc-600 */
}

.category-tag-9.active {
    background-color: #0284c7; /* sky-600 */
}

/* Tag count and remove button styles */
.tag-count {
    margin-left: 4px;
    font-size: 0.7rem;
    opacity: 0.8;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 1px 5px;
    border-radius: 8px;
    display: inline-block;
    min-width: 18px;
    text-align: center;
}

.category-tag.active .tag-count {
    background-color: rgba(255, 255, 255, 0.3);
}

.tag-remove-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    line-height: 1;
    font-weight: bold;
    opacity: 0.7;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.375rem;
    background: none;
    border: none;
    padding: 0;
}

/* Ensure the X button is white in active tags */
.category-tag.active .tag-remove-btn {
    color: white !important;
    font-size: 1.2rem !important;
    opacity: 0.9;
    width: auto;
    height: auto;
}

.tag-remove-btn:hover {
    opacity: 1;
}

/* Footer styles */
.footer-text {
    color: #868e96;
    font-size: 0.75rem;
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: -0.01em;
}

.footer-divider {
    color: #adb5bd;
    opacity: 0.7;
}

/* Tag styles */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

/* Small tag remove button for the compact tags */
.tag-container .tag-remove-btn {
    font-size: 0.6rem;
    width: 14px;
    height: 14px;
    padding: 0;
    margin-left: 2px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.tag-container .tag-remove-btn:hover {
    opacity: 1;
}

.btn-close-sm {
    width: 0.7em;
    height: 0.7em;
}

/* Add tag form */
.add-tag-form,
.create-tag-form {
    max-width: 400px;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

/* Category tag styling */
.is-category {
    border-left: 4px solid #0dcaf0; /* Bootstrap info color */
    background-color: rgba(13, 202, 240, 0.05);
}

/* Add a folder icon to category tags */
.is-category .tag-name::before {
    content: "📁 ";
    margin-right: 4px;
}

/* Style for category badges in tag visualization */
.category-tag.is-category {
    background-color: #cff4fc !important;
    color: #055160 !important;
    border: 1px solid #9eeaf9;
    font-weight: 500;
}

/* Info box for tag manager */
.tag-info-box {
    background-color: #e3f2fd;
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
}

.tag-info-box p {
    margin-bottom: 0;
}

.tag-info-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Tag collection styling */
.tag-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    margin-bottom: 0.25rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
}

.tag-badge:hover {
    background-color: #dee2e6;
}

.tag-badge.is-category {
    background-color: #cff4fc;
    border-color: #9eeaf9;
}

.tag-badge.is-category:hover {
    background-color: #b4f0fa;
}

.tag-link {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
}

.tag-link:hover {
    color: #000;
    text-decoration: none;
}

.tag-badge.is-category .tag-link {
    color: #055160;
}

/* Standard remove button for non-active tags */
.tag-badge .tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.375rem;
    width: 1.25rem;
    height: 1.25rem;
    background: none;
    border: none;
    padding: 0;
    border-radius: 50%;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tag-badge .tag-remove-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Tag relationship editing styles */
.tag-relationship-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.relationship-edit-mode .tag-badge {
    position: relative;
    padding-right: 1.5rem;
}

.relationship-edit-mode .tag-remove-btn {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Animation for adding new tags */
@keyframes tagAdded {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tag-badge.tag-added {
    animation: tagAdded 0.3s ease-in-out;
}

/* Additional styles for clickable filter buttons */
.category-tag-btn {
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    border-radius: 16px;
    padding: 4px 12px;
    margin-bottom: 5px;
    font-size: 0.8rem;
    display: inline-block;
}

/* Make category overview tags clickable */
.category-tag[data-category] {
    cursor: pointer;
    transition: all 0.2s;
}

/* Tag badge styling for tag management */
.tag-badge {
    background-color: #f0f0f0;
    border-radius: 16px;
    padding: 4px 12px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    display: inline-block;
    border: 1px solid #e0e0e0;
}

.tag-badge.is-category {
    background-color: #e3f2fd;
    border-color: #bbdefb;
}

/* Tag collection for tag management */
.tag-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

/* Tag link styling */
.tag-link {
    color: #333;
    text-decoration: none;
}

.tag-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* VI badge styles */
.vi-badge {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
}

.vi-badge .tag-link {
    color: #1b5e20;
}

.vi-badge .tag-link:hover {
    color: #2e7d32;
}

/* Hover effects for individual tag colors */
.category-tag.category-tag-0:hover, .category-tag-0:hover {
    background-color: rgba(191, 219, 254, 0.9);
}

.category-tag.category-tag-1:hover, .category-tag-1:hover {
    background-color: rgba(187, 247, 208, 0.9);
}

.category-tag.category-tag-2:hover, .category-tag-2:hover {
    background-color: rgba(199, 210, 254, 0.9);
}

.category-tag.category-tag-3:hover, .category-tag-3:hover {
    background-color: rgba(221, 214, 254, 0.9);
}

.category-tag.category-tag-4:hover, .category-tag-4:hover {
    background-color: rgba(165, 243, 252, 0.9);
}

.category-tag.category-tag-5:hover, .category-tag-5:hover {
    background-color: rgba(251, 207, 232, 0.9);
}

.category-tag.category-tag-6:hover, .category-tag-6:hover {
    background-color: rgba(253, 230, 138, 0.9);
}

.category-tag.category-tag-7:hover, .category-tag-7:hover {
    background-color: rgba(216, 180, 254, 0.9);
}

.category-tag.category-tag-8:hover, .category-tag-8:hover {
    background-color: rgba(228, 228, 231, 0.9);
}

.category-tag.category-tag-9:hover, .category-tag-9:hover {
    background-color: rgba(186, 230, 253, 0.9);
} 