.gallery-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* Left Sidebar - Constellation List */
.constellation-sidebar {
    width: 320px;
    background: rgba(10, 0, 21, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-family: inherit;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}


.constellation-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

.constellation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.constellation-list::-webkit-scrollbar {
    width: 6px;
}

.constellation-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.constellation-list::-webkit-scrollbar-thumb {
    background: rgba(147, 112, 219, 0.3);
    border-radius: 3px;
}

.constellation-list::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 112, 219, 0.5);
}

.constellation-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.constellation-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateX(4px);
}

.constellation-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.constellation-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px;
    flex-shrink: 0;
}

.constellation-item-info {
    flex: 1;
    min-width: 0;
}

.constellation-item-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.2rem;
}

.constellation-item-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Right Display Area */
.constellation-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.constellation-display::-webkit-scrollbar {
    width: 8px;
}

.constellation-display::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.constellation-display::-webkit-scrollbar-thumb {
    background: rgba(147, 112, 219, 0.3);
    border-radius: 4px;
}

.constellation-display::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 112, 219, 0.5);
}

.display-header {
    padding: 1rem 1rem 1rem 1rem;
    text-align: center;
    flex-shrink: 0;
}

.display-header h1 {
    font-size: 2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}

.constellation-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
}

.display-content {
    flex-shrink: 0;
    min-height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.canvas-section.hidden {
    opacity: 0;
}

#constellationCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.illustration-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.illustration-section.hidden {
    opacity: 0;
}

.constellation-art {
    /* Fixed size based on smaller dimension of viewport - always centered */
    width: 50vmin;
    height: 50vmin;
    object-fit: contain;
    opacity: 0.9;
    display: none; /* Hidden by default until constellation is selected */
}

.constellation-art.loaded {
    /* Slightly more visible when fully processed */
    opacity: 0.9;
}

.constellation-info {
    padding: 1.5rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 0, 21, 0.6);
    flex-shrink: 0;
    height: 20vh;
    overflow-y: auto;
}

.constellation-info::-webkit-scrollbar {
    width: 6px;
}

.constellation-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.constellation-info::-webkit-scrollbar-thumb {
    background: rgba(147, 112, 219, 0.3);
    border-radius: 3px;
}

.constellation-info::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 112, 219, 0.5);
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
}

.info-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-label::after {
    content: ':';
}

.info-value {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* Constellation Description Section */
.constellation-description {
    margin-top: 2rem;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.constellation-description p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Empty state */
.display-content.empty::before {
    content: 'Select a constellation from the list';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    z-index: 3;
}

/* Toggle Controls - Below constellation meaning */
.toggle-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: nowrap;
}

.toggle-btn {
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.toggle-btn .toggle-label {
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Menu Toggle Button (Triangle) */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    position: absolute;
    right: -3.5rem;
    top: -0.5rem;
    z-index: 1;
}

.menu-toggle-btn .triangle-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    transition: transform 0.3s ease;
    line-height: 1;
}

.menu-toggle-btn:hover .triangle-icon {
    color: rgba(147, 112, 219, 0.9);
}

.menu-toggle-btn.open .triangle-icon {
    transform: rotate(180deg);
}

.display-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle-btn {
        display: flex;
        align-items: center;
        height: 1.5rem;
    }

    .menu-list {
        gap: 0.5rem !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .menu-list::-webkit-scrollbar {
        display: none;
    }

    .menu-bar {
        padding: 0.5rem 0 !important;
    }

    .menu-item a {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.5rem !important;
    }

    .gallery-container {
        flex-direction: row;
        position: relative;
    }

    .constellation-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 60px);
        border-right: 1px solid rgba(147, 112, 219, 0.3);
        border-bottom: none;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: visible;
    }

    .constellation-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
    }

    .constellation-display {
        width: 100%;
        height: calc(100vh - 60px);
    }

    .constellation-art {
        width: 70vw !important;
        height: 70vw !important;
    }

    .display-header {
        padding: 1rem 0.5rem 0.8rem 0.5rem !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .display-header h1 {
        font-size: 1.5rem !important;
        padding: 0 !important;
        margin-bottom: 0.5rem !important;
        max-width: 100% !important;
        line-height: 1.2 !important;
    }

    .constellation-subtitle {
        font-size: 1rem !important;
        padding: 0 !important;
        max-width: 100% !important;
        line-height: 1.2 !important;
    }

    .toggle-controls {
        margin-top: 0.6rem !important;
        gap: 0.3rem !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .toggle-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    .toggle-btn .toggle-label {
        display: inline-block !important;
        max-width: 100% !important;
    }
}
