/* Gravity Spy Viewer Styles */

:root {
    --view-offset: 0%;
}

/* AG Grid overrides */
.ag-center-cols-viewport { 
    min-height: 100px !important; 
}

.ag-header-cell-label { 
    justify-content: center; 
}

/* Toolbar dropdown buttons - consistent width */
.gsv-dropdown-btn {
    min-width: 180px;
    text-align: left;
    position: relative;
}

.gsv-dropdown-btn::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Thumbnail grid cells */
.thumbnail-container { 
    width: 100px; 
    height: 75px;
    overflow: hidden;
    position: relative;
    background-image: url(/static/img/gravity_spy.gif); 
    background-size: cover;
}

.thumbnail { 
    width: 100px; 
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform: translateY(var(--view-offset));
}

/* Modal image handling */
.modal-image-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
}

#modal_image {
    width: 100%;
    height: 200%;
    object-fit: fill;
    transition: transform 0.3s ease;
    transform: translateY(var(--view-offset));
}

/* Channel tree container */
.channel-tree-container {
    max-height: 350px;
    overflow-y: auto;
}

/* Base channel group styling */
.channel-group {
    margin-bottom: 0.15rem;
}

.channel-group-header {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    user-select: none;
    gap: 0.35rem;
    border-radius: 3px;
}

.channel-group-header:hover {
    background: #e9ecef;
}

.channel-group-toggle {
    width: 14px;
    text-align: center;
    font-size: 0.7rem;
    color: #6c757d;
}

.channel-group-checkbox {
    margin: 0;
}

.channel-group-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
}

.channel-group-count {
    font-size: 0.7rem;
    color: #6c757d;
}

.channel-group-items {
    display: none;
    padding-left: 1.25rem;
}

.channel-group.expanded > .channel-group-items {
    display: block;
}

.channel-group.expanded > .channel-group-header .channel-group-toggle::before {
    content: "▼";
}

.channel-group:not(.expanded) > .channel-group-header .channel-group-toggle::before {
    content: "▶";
}

/* L1 (subsystem) styling */
.channel-group-l1 {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.channel-group-l1 > .channel-group-header {
    background: #f8f9fa;
    font-weight: 600;
}

.channel-group-l1 > .channel-group-items {
    background: #fff;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
}

/* L2 (component) styling */
.channel-group-l2 > .channel-group-header {
    background: transparent;
    padding: 0.2rem 0.3rem;
}

.channel-group-l2 > .channel-group-header:hover {
    background: #f0f0f0;
}

.channel-group-l2 > .channel-group-items {
    padding-left: 1.5rem;
    max-height: 150px;
    overflow-y: auto;
}

/* Channel items (leaves) */
.channel-item {
    display: flex;
    align-items: center;
    padding: 0.1rem 0;
    gap: 0.3rem;
}

.channel-item label {
    font-size: 0.75rem;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bulk action buttons */
.channel-bulk-actions {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.channel-bulk-actions .btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Glitch visibility styling */
.glitch-item {
    display: flex;
    align-items: center;
    padding: 0.15rem 0;
    gap: 0.4rem;
}

.glitch-item.unavailable {
    opacity: 0.5;
}

.glitch-item.unavailable label {
    text-decoration: line-through;
    color: #6c757d;
}

.glitch-item label {
    font-size: 0.85rem;
    margin: 0;
    cursor: pointer;
}