/* Aatman Bhaav - Core Design System */
body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #050b14; 
    color: white; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
}

#3d-graph { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; }

.header { 
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background: rgba(5, 11, 20, 0.9); backdrop-filter: blur(15px);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-transform: uppercase; letter-spacing: 3px; color: #fff;
}

#top-progress-container {
    position: fixed; top: 60px; left: 0; width: 100%; height: 3px;
    background: rgba(255,255,255,0.05); z-index: 999;
}
#top-progress-fill { height: 100%; width: 0%; background: #2af598; transition: width 0.4s ease; }

#top-progress-text {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    font-size: 0.7rem; color: #2af598; text-transform: uppercase; letter-spacing: 1.5px;
    z-index: 999; font-weight: 600;
}

/* Fixed Panels (Left & Right) */
.panel {
    position: fixed; top: 90px; height: calc(100vh - 120px);
    background: rgba(10, 15, 28, 0.92); backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
    z-index: 1500; padding: 25px; display: flex; flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    pointer-events: auto;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; /* Container fixed, inner tray scrolls */
}

#selected-tags-tray { 
    flex-grow: 1; 
    overflow-y: auto; 
    margin-bottom: 15px; 
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #2af598 transparent;
}
#selected-tags-tray::-webkit-scrollbar { width: 4px; }
#selected-tags-tray::-webkit-scrollbar-thumb { background: #2af598; border-radius: 10px; }

#left-panel { left: -350px; width: 300px; }
#left-panel.open { 
    left: 20px; 
}

#right-panel { right: 20px; width: 320px; border-color: rgba(42, 245, 152, 0.2); }

/* Toggle Button for Left Panel */
#left-panel-toggle {
    position: fixed; bottom: 20px; left: 20px;
    padding: 12px 24px; border-radius: 8px;
    background: linear-gradient(135deg, #2af598, #00d2ff);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    z-index: 1600; cursor: pointer; box-shadow: 0 10px 30px rgba(42, 245, 152, 0.3);
    border: none; color: #000; font-weight: 800; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 1px;
}
#left-panel-toggle svg { width: 18px; height: 18px; fill: #000; }

.panel-title { 
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; 
    color: #666; margin-bottom: 20px; font-weight: 700;
}

#selected-tags-tray { flex-grow: 1; overflow-y: auto; padding-right: 5px; }

.floating-btn {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 10px 15px; color: #eee;
    font-size: 0.8rem; display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; cursor: pointer;
}

.mbti-title { color: #2af598; font-size: 3rem; margin: 0; font-weight: 900; }

.profile-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.profile-form input, .profile-form textarea {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 12px; border-radius: 10px; font-size: 0.85rem; outline: none;
}
.profile-form button {
    background: linear-gradient(135deg, #2af598, #00d2ff); color: #050b14;
    border: none; padding: 15px; border-radius: 10px; font-weight: 800; cursor: pointer;
    text-transform: uppercase; font-size: 0.85rem;
}

/* Bottom Sheet */
#category-bottom-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%; height: 25vh; /* Reduced height to ribbon */
    background: rgba(5, 11, 20, 0.95); backdrop-filter: blur(40px);
    border-radius: 20px 20px 0 0; border-top: 1px solid rgba(255,255,255,0.15);
    z-index: 3000; transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px; box-sizing: border-box; display: flex; flex-direction: column;
}

#bottom-sheet-grid {
    display: grid !important;
    grid-template-rows: repeat(3, 1fr); /* 3 continuous rows */
    grid-auto-flow: column;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
}
#bottom-sheet-grid::-webkit-scrollbar { height: 4px; }
#bottom-sheet-grid::-webkit-scrollbar-thumb { background: #2af598; border-radius: 10px; }

.grid-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #ccc; padding: 10px 15px; border-radius: 10px; font-size: 0.75rem; cursor: pointer;
    white-space: nowrap;
}

/* Overlays */
#analysis-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #050b14; z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.hidden { display: none !important; }
.status-bar { padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05); }
.progress-track { height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: #2af598; transition: width 0.5s ease; }

/* Responsive adjustments */
@media (max-width: 800px) {
    .panel { width: 80vw; top: 70px; padding: 15px; }
    #left-panel { left: -85vw; }
    #left-panel.open { left: 10px; }
    #right-panel { right: 10px; width: 80vw; }
    .mbti-title { font-size: 2.2rem; }
    #left-panel-toggle { bottom: 20px; left: 20px; width: 50px; height: 50px; }
}
