/* Sushi Bar Drawer System CSS */

/* Container modifications for drawer layout */
.drawer-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.drawer-container #sushiBar {
    height: 100%;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: none;
}

/* Main chat area adjustments */
.drawer-container #noren {
    padding: 10px;
    font-size: 24px;
    flex-shrink: 0;
}

.drawer-container #venueInfo {
    padding: 3px;
    font-size: 12px;
    flex-shrink: 0;
}

.drawer-container #chatArea {
    flex: 1;
    height: auto;
    min-height: 300px;
    overflow-y: auto;
}

.drawer-container #inputArea {
    padding: 10px;
    flex-shrink: 0;
}

/* Only hide menu bar if drawer is initialized and active */
.drawer-container.drawer-active #menuBar {
    display: none;
}

/* Keep wallet display visible on desktop */
.drawer-container #walletDisplay {
    /* Keep visible but adjust z-index to not conflict with drawers */
    z-index: 100;
}

/* Hide command buttons when drawer is active */
.drawer-container.drawer-active .commandButton {
    display: none;
}

/* Keep conveyor belt visible but optimize space */
.drawer-container #conveyorBelt {
    height: 80px;
    margin: 10px 0;
    flex-shrink: 0;
}

/* Drawer base styles */
.drawer {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #FFD700;
    transition: transform 0.3s ease-out;
    z-index: 1000;
    overflow-y: auto;
}

/* Shoji screen pattern overlay */
.drawer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 20px,
            rgba(255, 215, 0, 0.05) 20px,
            rgba(255, 215, 0, 0.05) 21px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 20px,
            rgba(255, 215, 0, 0.05) 20px,
            rgba(255, 215, 0, 0.05) 21px
        );
    pointer-events: none;
}

/* Left Drawer - Menu */
.drawer-left {
    left: 0;
    top: 0;
    height: 100%;
    width: 320px;
    transform: translateX(-100%);
    border-right: 3px solid #FFD700;
}

.drawer-left.open {
    transform: translateX(0);
    box-shadow: 5px 0 20px rgba(255, 215, 0, 0.3);
}

/* Right Drawer - Profile/Stats */
.drawer-right {
    right: 0;
    top: 0;
    height: 100%;
    width: 300px;
    transform: translateX(100%);
    border-left: 3px solid #FFD700;
}

.drawer-right.open {
    transform: translateX(0);
    box-shadow: -5px 0 20px rgba(255, 215, 0, 0.3);
}

/* Bottom drawer removed - using command dropdown instead */

/* Drawer headers */
.drawer-header {
    position: sticky;
    top: 0;
    padding: 15px;
    border-bottom: 2px solid #FFD700;
    background: linear-gradient(180deg, #1a1a1a 0%, #000 90%);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 18px;
}

.drawer-close {
    background: none;
    border: 1px solid #FFD700;
    color: #FFD700;
    font-size: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.drawer-close:hover {
    background: #FFD700;
    color: #000;
}

/* Drawer content */
.drawer-content {
    padding: 20px;
}

/* Toggle buttons */
.drawer-toggle {
    position: fixed;
    background: #000;
    border: 2px solid #FFD700;
    color: #FFD700;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    z-index: 999;
}

.drawer-toggle:hover {
    background: #FFD700;
    color: #000;
}

.toggle-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    border-left: none;
    border-radius: 0 10px 10px 0;
    animation: menuPulse 2s ease-in-out infinite;
}

@keyframes menuPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
}

.toggle-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    border-right: none;
    border-radius: 10px 0 0 10px;
}

/* Bottom toggle removed */

/* Menu grid in left drawer */
#menuGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar for menu */
#menuGrid::-webkit-scrollbar {
    width: 6px;
}

#menuGrid::-webkit-scrollbar-track {
    background: #111;
}

#menuGrid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

#menuGrid::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.menu-drawer-item {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-drawer-item:hover {
    background: #333;
    border-color: #FFD700;
    transform: translateY(-2px);
}

.menu-drawer-item img {
    width: 40px;
    height: 40px;
    display: block;
    margin: 0 auto 5px;
}

.menu-drawer-item .item-name {
    font-size: 12px;
    color: #FFD700;
}

.menu-drawer-item .item-price {
    font-size: 11px;
    color: #FFF;
}

/* Profile content in right drawer */
.profile-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
}

.profile-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 14px;
}

.stat-label {
    color: #999;
}

.stat-value {
    color: #FFF;
}

/* Command dropdown styles */
#commandDropdown {
    box-shadow: 0 -5px 20px rgba(255, 215, 0, 0.2);
}

#commandDropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #FFD700;
}

/* Mobile overlay and responsive adjustments */
@media (max-width: 768px) {
    /* Make container full height on mobile */
    .drawer-container #sushiBar {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
    }
    
    /* Drawer adjustments */
    .drawer-left {
        width: 85%;
        max-width: 320px;
    }
    
    .drawer-right {
        width: 85%;
        max-width: 300px;
    }
    
    /* Don't push main content on mobile */
    .drawer-left-open #sushiBar,
    .drawer-right-open #sushiBar {
        margin-left: 0;
        margin-right: 0;
    }
    
    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .drawer-open .drawer-overlay {
        display: block;
    }
    
    /* Larger toggle buttons for touch */
    .drawer-toggle {
        width: 50px;
        height: 70px;
        font-size: 18px;
    }
    
    .toggle-left {
        width: 70px;
        border-radius: 0 15px 15px 0;
    }
    
    .toggle-right {
        width: 50px;
        border-radius: 15px 0 0 15px;
    }
    
    /* Compact mode adjustments */
    #compactModeToggle {
        top: 5px;
        right: 5px;
        padding: 3px 8px;
        font-size: 10px;
    }
    
    /* Menu grid adjustments */
    #menuGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .menu-drawer-item {
        padding: 15px;
    }
    
    .menu-drawer-item img {
        width: 35px;
        height: 35px;
    }
    
    /* Command dropdown adjustments */
    #commandDropdown {
        bottom: 100%;
        left: 10px;
        right: 10px;
        max-width: none;
        width: auto;
    }
    
    .command-item {
        padding: 12px !important;
    }
}

/* Adjust main content when drawers are open */
.drawer-left-open #sushiBar {
    margin-left: 320px;
}

.drawer-right-open #sushiBar {
    margin-right: 300px;
}

/* Compact mode styles */
.compact-mode #noren {
    padding: 5px;
    font-size: 20px;
}

.compact-mode #venueInfo {
    display: none;
}

.compact-mode #chatArea {
    min-height: 250px;
}

.compact-mode #inputArea {
    padding: 5px;
}

.compact-mode #messageInput {
    font-size: 12px;
    padding: 5px;
}

.compact-mode .drawer-toggle {
    width: 30px;
    height: 60px;
    font-size: 16px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.drawer-content > * {
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

.drawer.open .drawer-content > * {
    opacity: 1;
}

/* Bamboo decoration for menu drawer */
.drawer-left::after {
    content: '🎋';
    position: absolute;
    bottom: 20px;
    right: 10px;
    font-size: 60px;
    opacity: 0.1;
    transform: rotate(-15deg);
}