/* style.css */

/* Core Layout Setup - No Duplicates */
body, html { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    width: 100%;
    height: 100%;
    background: #1a1a1a; 
    font-family: sans-serif; 
}

#game-viewport { 
    width: 100vw; 
    height: 100vh; 
    position: absolute;
    top: 0;
    left: 0;
}

canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: none !important; 
    border-radius: 0px !important; 
}

/* Modal UI Transitions */
.modal-card {
    background: #2a2a2a; 
    border-radius: 12px; 
    border: 2px solid #ffaa00; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: 0px 4px 30px rgba(0,0,0,0.7);
    transition: width 0.3s ease, height 0.3s ease;
}

.action-btn {
    display: inline-block; 
    margin: 10px 5px 0 5px; 
    padding: 10px 20px; 
    background: #ffaa00; 
    color: #1a1a1a; 
    text-decoration: none; 
    font-weight: bold; 
    border-radius: 6px; 
    border: none;
    cursor: pointer;
}
.action-btn:hover { background: #e09600; }

/* Mobile HUD Zoom Slider Layout */
#mobile-zoom-container {
    display: none; /* Hidden by default on desktop viewports */
    position: fixed; 
    left: 50%;
    top: 20px;               
    transform: translateX(-50%); 
    z-index: 10005; 
    background: rgba(0, 0, 0, 0.7); 
    padding: 8px 20px; 
    border-radius: 20px;
    border: 2px solid #ffaa00;
    align-items: center;
    justify-content: center;
    width: 60%;          
    max-width: 300px;    
}

/* Responsive break target: Force show only on smaller mobile viewports */
@media (max-width: 800px) {
    #mobile-zoom-container {
        display: flex; 
    }
}

/* Mobile Contextual Interact Button */
#mobile-interact-btn {
    display: none; 
    position: fixed; 
    bottom: 30px; 
    right: 20px; 
    padding: 18px 32px; 
    font-size: 18px; 
    font-weight: bold; 
    background: #ffaa00; 
    color: #1a1a1a; 
    border: 3px solid #ffffff; 
    border-radius: 50px; 
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.6); 
    z-index: 9998; 
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile Touch Joystick Wrapper Zone */
#mobile-joystick-zone {
    display: none; 
    position: fixed; 
    bottom: 30px; 
    left: 30px; 
    width: 150px; 
    height: 150px; 
    z-index: 9999;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================
   NIPPLEJS CUSTOM IMAGE GRAPHICS OVERRIDES
   ========================================================== */

/* THE OUTER LARGE RING (THE JOYSTICK BASE) */
#mobile-joystick-zone .nipple .base {
    background-image: url('assets/images/joystick-base.png') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
    background-color: transparent !important; /* Wipes out default colors */
    border: none !important; 

    opacity: 5.0 !important; 
}

/* THE INNER MOVING KNOB (THE THUMBSTICK PIECE) */
#mobile-joystick-zone .nipple .front {
    background-image: url('assets/images/joystick-knob.png') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
    background-color: transparent !important; /* Wipes out default colors */
    border: none !important; 


    /* OPACITY CONTROL: Keeping the center knob more solid so it stands out */
    opacity: 0.9 !important; 
}
/* ===============================================
   THE FlOAoting LAYOUT CSS
   ===============================================

/* App Wrapper covering the viewport */
#app-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Allows mouse clicks to pass straight down to Phaser canvas */
    z-index: 999;
}

/* Base style for both sliding sidebars */
.sliding-sidebar {
    position: fixed;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(26, 26, 26, 0.95);
    border-color: #ffb703;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto; /* Restores clicking behavior inside the sidebars */
    color: #fff;
    font-family: sans-serif;
}

/* Positioning Offscreen left/right */
#sidebar-left {
    left: 0;
    transform: translateX(-280px); /* Hidden offscreen left */
    border-right: 2px solid #ffb703;
}
#sidebar-right {
    right: 0;
    transform: translateX(280px); /* Hidden offscreen right */
    border-left: 2px solid #ffb703;
}

/* Active visible states triggered via JS classes */
#sidebar-left.is-open { transform: translateX(0); }
#sidebar-right.is-open { transform: translateX(0); }

/* Sidebar Internal content spacing */
.sidebar-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

/* Interactive click handles / tabs */
.sidebar-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffb703;
    color: #1a1a1a;
    padding: 12px 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    border-radius: 4px;
    opacity: 0; /* Hidden completely by default */
    transition: opacity 0.2s ease, background 0.2s;
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    display: flex;
    align-items: center;     /* Centers text vertically */
    justify-content: center;   /* Centers text horizontally */
}
.sidebar-handle:hover { background: #fb8500; }

/* Position tabs right outside the panels */
.tab-left { right: -100px; border-radius: 0 4px 4px 0; height: 30%; vertical-align: middle;}
.tab-right { left: -100px; border-radius: 4px 0 0 4px; height: 30%; vertical-align: middle; }

/* Edge detection hover padding zones */
.edge-hover-zone-left, .edge-hover-zone-right {
    position: fixed;
    top: 0;
    width: 25px;
    height: 100vh;
    pointer-events: auto;
    z-index: 998;
}
.edge-hover-zone-left { left: 0; }
.edge-hover-zone-right { right: 0; }

/* Styling for directory fast-travel buttons */
.nav-directory { list-style: none; padding: 0; margin: 0; }
.nav-directory li { margin-bottom: 8px; }
.nav-directory button {
    width: 100%;
    background: #333;
    color: #fff;
    border: 1px solid 55px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.nav-directory button:hover 
{ background: #ffb703; color: #000; }

/* Styling for inventory grid badges on the right side panel */
.inventory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.inventory-badge {
    background: #333;
    border: 1px solid #ffb703;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 20px;
    text-transform: capitalize;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-row {
    font-size: 16px;
    font-weight: bold;
    color: #ffb703;
    margin: 10px 0;
}

@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Bubble box */

.dialog-btn {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 15px 20px !important;
    
    background-color: #FFD700 !important; /* Yellow */
    color: #000000 !important;            /* Black text */
    
    border: 3px solid #000000 !important; /* Thick black border */
    border-radius: 0 !important;          /* Sharp corners */
    font-size: 18px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    text-align: center !important;
}
.dialog-btn:hover {
    background-color: #FFC107 !important; /* Slightly darker yellow on hover */
    transform: scale(1.02);               /* Slight pop effect */
}

/* Ensure the container holds them nicely */
.buttons-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column; /* Stacks buttons on top of each other */
    gap: 10px;
}

/* Bubble BOX */

#dialog-bubble {
    display: none; 
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    width: 60% !important;
    max-width: 600px !important;
    padding: 25px !important;
    
    background: #1a1a1a !important; /* Deep dark charcoal */
    color: #ffffff !important;
    border: 4px solid #ffffff !important; /* Thick white border */
    border-radius: 0 !important; /* Sharp corners */
    z-index: 10000 !important;
    
    /* Subtle shadow for depth */
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Character Name */
#dialog-bubble .name {
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffcc00; /* Classic gold color */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dialog Text */
#dialog-bubble .text {
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.4;
}

#dialog-bubble .buttons-container {
    margin-top: 15px;
}



/* .dialog-btn:hover, .dialog-btn:focus {
    background: #555555;
    border-color: #ffffff;
    outline: none;
} */

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #dialog-bubble {
        width: 90% !important;
        padding: 15px !important;
    }
}
