/* Mind Palace Room System - Phase 1
   Spatial navigation, minimal Y-axis, proprioceptive anchoring */

#room-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #1a0f0a 0%, #0d0705 100%);
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

/* Room Header */
.room-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    border-bottom: 2px solid #8b4513;
    z-index: 100;
}

.room-header h1 {
    color: #ffd700;
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.room-meta-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.room-meta {
    display: flex;
    gap: 12px;
    color: #ccc;
    font-size: 13px;
}

.room-meta span {
    background: rgba(139,69,19,0.4);
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid rgba(255,215,0,0.2);
}

#room-description {
    color: #aaa;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 800px;
}

/* Bookshelf Container */
#bookshelf {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 1200px;
    height: calc(100vh - 280px);
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(0,0,0,0.4);
    border: 3px solid #8b4513;
    border-radius: 8px;
    padding: 20px 30px;
    white-space: nowrap;
}

#bookshelf:focus {
    outline: 2px solid #ffd700;
    outline-offset: 4px;
}

/* Wing Indicators */
.wing-indicator {
    position: absolute;
    top: -40px;
    left: 0;
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    background: rgba(139,69,19,0.6);
    border-radius: 4px;
    border: 1px solid #ffd700;
}

.wing-west { background: rgba(173,216,230,0.3); border-color: #add8e6; }
.wing-east { background: rgba(255,215,0,0.3); border-color: #ffd700; }
.wing-north { background: rgba(144,238,144,0.3); border-color: #90ee90; }
.wing-south { background: rgba(255,160,122,0.3); border-color: #ffa07a; }

/* Shelf Sections */
.shelf-section {
    display: inline-block;
    vertical-align: top;
    margin-right: 40px;
    min-width: 200px;
}

.shelf-label {
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #8b4513;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.books-row {
    display: inline-flex;
    gap: 6px;
    align-items: flex-end;
    padding: 10px;
    background: rgba(139,69,19,0.15);
    border-radius: 4px;
    border: 1px solid rgba(139,69,19,0.3);
}

/* Book Styling */
.book {
    width: 38px;
    height: 55px;
    background: linear-gradient(90deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
    border: 1px solid #654321;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

.book:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255,215,0,0.4);
    z-index: 10;
}

.book-spine {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #ffd700;
    font-size: 9px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 48px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* File Type Colors */
.book-file {
    background: linear-gradient(90deg, #2c5282 0%, #4299e1 50%, #2c5282 100%);
}

.book-folder {
    background: linear-gradient(90deg, #744210 0%, #d69e2e 50%, #744210 100%);
}

.book[data-ext="py"] {
    background: linear-gradient(90deg, #3776ab 0%, #4d8dc7 50%, #3776ab 100%);
}

.book[data-ext="js"] {
    background: linear-gradient(90deg, #f7df1e 0%, #ffd700 50%, #f7df1e 100%);
    color: #000;
}

.book[data-ext="json"] {
    background: linear-gradient(90deg, #cb3837 0%, #f06543 50%, #cb3837 100%);
}

.book[data-ext="md"] {
    background: linear-gradient(90deg, #519aba 0%, #7dc3e0 50%, #519aba 100%);
}

.book[data-ext="css"] {
    background: linear-gradient(90deg, #264de4 0%, #4d80e4 50%, #264de4 100%);
}

.book[data-ext="html"] {
    background: linear-gradient(90deg, #e34c26 0%, #f06529 50%, #e34c26 100%);
}

.book[data-ext="java"] {
    background: linear-gradient(90deg, #b07219 0%, #d49429 50%, #b07219 100%);
}

.book[data-ext="sh"] {
    background: linear-gradient(90deg, #4d5a5f 0%, #6c7a82 50%, #4d5a5f 100%);
}

.book[data-ext="txt"] {
    background: linear-gradient(90deg, #6c757d 0%, #868e96 50%, #6c757d 100%);
}

/* File Viewer Panel */
#file-viewer {
    position: absolute;
    top: 140px;
    right: 5%;
    width: 35%;
    min-width: 350px;
    height: calc(100vh - 280px);
    background: rgba(0,0,0,0.95);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 25px;
    display: none;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(255,215,0,0.2);
}

#file-viewer h3 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #8b4513;
    padding-bottom: 12px;
}

.file-placeholder, .folder-placeholder {
    color: #ddd;
    line-height: 1.7;
    font-size: 14px;
}

.file-placeholder h4, .folder-placeholder h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 16px;
}

.view-on-github {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(180deg, #2c5282 0%, #1a365d 100%);
    color: #ffd700;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #ffd700;
    font-weight: bold;
    transition: all 0.2s;
}

.view-on-github:hover {
    background: linear-gradient(180deg, #4299e1 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,215,0,0.3);
}

/* Back Button */
#back-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 50px;
    background: linear-gradient(180deg, #8b4513 0%, #654321 100%);
    color: #ffd700;
    border: 2px solid #ffd700;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

#back-button:hover {
    background: linear-gradient(180deg, #a0522d 0%, #8b4513 100%);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(255,215,0,0.3);
}

/* Empty State */
.empty-shelf {
    display: inline-block;
    vertical-align: middle;
    color: #888;
    font-size: 16px;
    text-align: center;
    padding: 40px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 2px dashed #666;
}

.empty-shelf small {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 12px;
}

/* Scrollbar Styling */
#bookshelf::-webkit-scrollbar {
    height: 14px;
}

#bookshelf::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.4);
    border-radius: 7px;
}

#bookshelf::-webkit-scrollbar-thumb {
    background: #8b4513;
    border-radius: 7px;
    border: 2px solid rgba(0,0,0,0.4);
}

#bookshelf::-webkit-scrollbar-thumb:hover {
    background: #a0522d;
}

/* Responsive */
@media (max-width: 768px) {
    .room-header h1 { font-size: 20px; }
    #bookshelf { width: 95%; top: 160px; height: calc(100vh - 320px); }
    #file-viewer { width: 90%; right: 5%; }
    .book { width: 32px; height: 48px; }
}
