/* CD-THEQUE THREE.JS STYLES */
#cdtheque-three-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #111 0%, #000 100%);
    pointer-events: none; /* Blocked by default */
}

#cdtheque-overlay.opacity-100 #cdtheque-three-container {
    cursor: crosshair;
}

#cdtheque-ui-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#cdtheque-overlay.opacity-100 #cdtheque-ui-layer > * {
    pointer-events: auto;
}

#cdtheque-overlay {
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide legacy styles if they interfere */
.cd-item, .jewel-case { display: none !important; }

/* Real 3D Sides */
.cd-side {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.side-top, .side-bottom {
    width: 100%;
    height: 10px; /* Real thickness */
    left: 0;
}
.side-top { top: -5px; transform: rotateX(90deg); }
.side-bottom { bottom: -5px; transform: rotateX(-90deg); }

.side-left, .side-right {
    width: 10px;
    height: 100%;
    top: 0;
}
.side-left { left: -5px; transform: rotateY(-90deg); }
.side-right { right: -5px; transform: rotateY(90deg); }

.cd-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 1px;
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 45px rgba(0,0,0,0.9);
    -webkit-font-smoothing: antialiased;
}

/* Front Face - Pushed forward */
.cd-face-front {
    z-index: 2;
    transform: rotateY(0deg) translateZ(5px);
}

.cd-artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.05) brightness(0.95);
}

/* Gloss/Plastic Reflection Overlay - Improved */
.cd-glass-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        var(--specular-deg, 135deg),
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0) 25%,
        rgba(255, 255, 255, 0) 75%,
        rgba(255, 255, 255, 0.15) 100%
    );
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Back Face - Pushed backward */
.cd-face-back {
    transform: rotateY(180deg) translateZ(5px);
    background: #020202;
    display: flex;
    flex-direction: column;
}

.cd-back-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    filter: blur(5px);
    z-index: 1;
}

.cd-tracklist-container {
    position: relative;
    z-index: 2;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cd-album-info {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.cd-album-title {
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cd-album-artist {
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    opacity: 0.7;
}

.cd-track-item {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.cd-track-item:hover {
    background: rgba(var(--accent-primary-rgb), 0.2);
    color: white;
}

.cd-track-num {
    opacity: 0.3;
    margin-right: 6px;
    font-family: monospace;
}

/* Iridescent/Holographic Strip on the side */
.cd-side-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to bottom, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    background-size: 100% 400%;
    animation: rainbow-scroll 10s linear infinite;
    z-index: 4;
}

@keyframes rainbow-scroll {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

/* Hide scrollbar for tracklist */
.cd-tracklist-container::-webkit-scrollbar {
    width: 0px;
}

/* SEARCH COCKPIT UI */
.search-cockpit-container {
    display: flex;
    align-items: center;
    background: rgba(15, 15, 15, 0.4);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 6px 8px 6px 20px;
    width: 600px;
    max-width: 90vw;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.5),
        inset 0 1px 1px rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-cockpit-container:focus-within {
    width: 750px;
    background: rgba(20, 20, 20, 0.6);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    box-shadow: 
        0 30px 70px rgba(0,0,0,0.7),
        0 0 20px rgba(var(--accent-primary-rgb), 0.1),
        inset 0 1px 1px rgba(255,255,255,0.1);
}

.search-cockpit-icon {
    color: rgba(255, 255, 255, 0.3);
    margin-right: 15px;
    transition: color 0.3s;
}

.search-cockpit-container:focus-within .search-cockpit-icon {
    color: var(--accent-primary);
}

.search-cockpit-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
    font-family: "Outfit", sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 10px 0;
}

.search-cockpit-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-weight: 800;
    letter-spacing: 0.2em;
}

.search-cockpit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-shortcut-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    font-size: 9px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.search-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

/* Updated Debug HUD */
.debug-status {
    font-weight: 900;
    text-shadow: 0 0 10px currentColor;
}
