/* ULTRA DROPDOWN & OVERLAP FIXES */

/* Layout Height Constraint */
.artifact-panel {
    max-height: calc(100vh - 120px); /* Ensure it fits between nav and footer area */
    display: flex;
    flex-direction: column;
}

.panel-content {
    overflow-y: auto; /* Enable internal scrolling */
    max-height: 100%; /* Fill remaining space */
    padding-bottom: 80px; /* Space for sticky footer buttons if needed */
}

/* Custom Select Styles */
.ultra-select-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
    z-index: 100; /* Ensure dropdown floats on top */
}

.ultra-select-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.ultra-select-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(100, 255, 218, 0.3);
}

.ultra-select-trigger i {
    color: var(--accent-primary);
    transition: transform 0.3s;
}

/* GENIUS MODE: Viewport-Centric Dropdown Panel */
.ultra-select-dropdown {
    position: fixed; /* Break out of the container */
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 600px; /* Wide enough for grid layout if needed */
    transform: translate(-50%, -40%) scale(0.95); /* Start slightly off */
    background: #0e2542;
    border: 1px solid var(--accent-primary);
    border-radius: 16px;
    max-height: 80vh; /* Never overflow screen */
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy pop */
    box-shadow: 0 25px 100px -20px rgba(0,0,0,0.9), 0 0 30px rgba(100, 255, 218, 0.1);
    z-index: 9999; /* Top of everything */
    display: flex;
    flex-direction: column;
}

/* Overlay Backdrop */
.ultra-select-dropdown::before {
    content: '';
    position: fixed;
    top: -100vh; left: -100vw;
    width: 300vw; height: 300vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none; /* Let clicks pass through if needed, but we want to block */
}

.ultra-select-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.ultra-select-dropdown.open::before {
    opacity: 1;
    pointer-events: all;
}

/* Rotate arrow when open */
.ultra-select-dropdown.open ~ .ultra-select-trigger i, 
.ultra-select-trigger.active i { 
    transform: rotate(180deg); 
}


.select-option {
    padding: 20px 30px; /* Larger click area */
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
    color: var(--text-main);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.select-option:hover {
    background: rgba(100, 255, 218, 0.15);
    padding-left: 40px;
    color: #fff;
}

.select-option:last-child {
    border-bottom: none;
}

/* Scrollbar for dropdown */
.ultra-select-dropdown::-webkit-scrollbar { width: 6px; }
.ultra-select-dropdown::-webkit-scrollbar-thumb { background: rgba(100,255,218,0.2); border-radius: 3px; }

/* Adjust grid for smaller height if needed */
.grid-options {
    max-height: 100%;
}
