:root {
    --bg-primary: #080808;
    --bg-secondary: #121212;
    --bg-card: #181818;
    --accent: #e0e0e0;
    --accent-soft: rgba(224, 224, 224, 0.08);
    --accent-glow: rgba(224, 224, 224, 0.4);
    --success: #00ff88;
    --text-main: #f0f0f0;
    --text-muted: #666666;
    --text-dark: #333333;
    --radius-main: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body { 
    margin: 0; 
    font-family: 'Roboto', sans-serif; 
    color: var(--text-main); 
    overflow: hidden; 
    user-select: none;
    background: transparent !important; 
}

#app {
    display: none;
    justify-content: center; 
    align-items: center;
    height: 100vh; 
    width: 100vw;
    background: rgba(0, 0, 0, 0.75);
}

.vending-container {
    position: relative; 
    width: 1100px; 
    height: 820px;
    background: linear-gradient(145deg, #0f0f0f, #050505); 
    border-radius: var(--radius-main);
    padding: 25px; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; 
    flex-direction: column;
    box-shadow: 0 50px 100px rgba(0,0,0,0.9);
}

.vending-container::after {
    content: " ";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 10;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: 0.2;
}

.close-button {
    position: absolute; top: 20px; right: 20px; width: 40px; height: 40px;
    display: flex; justify-content: center; align-items: center;
    color: var(--text-muted); cursor: pointer; transition: var(--transition); z-index: 1000;
    border-radius: 50%; background: rgba(255,255,255,0.03);
}
.close-button:hover { color: #ff4d4d; background: rgba(255, 77, 77, 0.1); transform: rotate(90deg); }

.main-body { display: flex; height: 100%; gap: 20px; z-index: 5; }

.item-section {
    flex: 2.5; 
    background: rgba(0,0,0,0.2); 
    border-radius: var(--radius-main);
    padding: 15px; 
    border: 1px solid rgba(255,255,255,0.02); 
    display: flex; 
    flex-direction: column;
}

.scroll-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 10px;
    scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }

.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }

.item-card {
    background: linear-gradient(180deg, #181818 0%, #0f0f0f 100%); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-main); 
    padding: 40px 15px;
    position: relative; 
    transition: var(--transition);
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.item-card:hover { 
    border-color: rgba(255,255,255,0.2); 
    transform: translateY(-5px); 
    background: #1e1e1e;
}

.item-card.selected { 
    border-color: var(--accent);
    background: #252525;
    box-shadow: 0 0 30px var(--accent-soft);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(224, 224, 224, 0.4); }
    50% { border-color: rgba(224, 224, 224, 1); }
}

.item-code {
    position: absolute; top: 12px; left: 12px; 
    background: #000; color: var(--accent);
    padding: 4px 12px; border-radius: 4px; 
    font-weight: 700; font-family: 'Roboto Mono', monospace; 
    font-size: 0.7rem; border: 1px solid #333;
}

.item-image { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5)); }

.item-name { margin-top: 20px; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }

.price-tag { position: absolute; bottom: 15px; right: 15px; color: var(--accent); font-weight: 900; font-size: 1rem; font-family: 'Orbitron'; }

.control-panel {
    flex: 1; 
    background: #0a0a0a; 
    border-radius: var(--radius-main);
    padding: 30px; 
    display: flex; 
    flex-direction: column; 
    border: 1px solid rgba(255,255,255,0.03);
}

.brand-header {
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.logo-main {
    font-family: 'Orbitron';
    font-weight: 900;
    font-size: 1.6rem;
    color: var(--accent);
    letter-spacing: 2px;
}

.logo-sub {
    font-family: 'Roboto Mono';
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 8px;
    text-transform: uppercase;
}

.brand-divider {
    width: 40px;
    height: 1px;
    background: var(--text-dark);
    margin: 12px 0;
}

.brand-subtitle {
    font-family: 'Roboto Mono';
    font-size: 0.55rem;
    color: var(--text-dark);
    letter-spacing: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.display-unit {
    background: #000; 
    height: 120px; 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    border: 1px solid #1a1a1a; 
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.display-unit::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.02);
    opacity: 0;
    pointer-events: none;
    animation: flicker 0.1s infinite;
}

@keyframes flicker {
    0% { opacity: 0.1; }
    50% { opacity: 0.02; }
    100% { opacity: 0.08; }
}

.screen-input { 
    color: var(--accent); 
    font-family: 'Orbitron'; 
    font-size: 2.5rem; 
    font-weight: 700; 
    letter-spacing: 8px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.screen-status { 
    font-size: 0.65rem; 
    color: #444; 
    text-transform: uppercase; 
    letter-spacing: 3px; 
    margin-bottom: 8px; 
}

.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.key { 
    height: 55px; 
    background: #151515; 
    border: 1px solid #222; 
    border-radius: 6px; 
    color: var(--accent); 
    font-family: 'Orbitron'; 
    cursor: pointer; 
    transition: 0.1s; 
    box-shadow: 0 4px 0 #000;
}

.key:hover { background: #1a1a1a; border-color: #333; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }

.action-buttons { margin-top: 25px; display: flex; flex-direction: column; gap: 12px; }

.btn-confirm { 
    background: var(--accent); 
    color: #000; 
    border: none; 
    padding: 18px; 
    border-radius: 6px; 
    font-weight: 900; 
    cursor: pointer; 
    transition: var(--transition); 
    text-transform: uppercase; 
    font-family: 'Orbitron';
}

.btn-confirm:hover { background: #fff; transform: scale(1.02); box-shadow: 0 0 20px rgba(255,255,255,0.2); }

.btn-clear { 
    background: transparent; 
    border: 1px solid #222; 
    color: #444; 
    padding: 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: var(--transition); 
    font-family: 'Orbitron';
    font-size: 0.7rem;
}

.btn-clear:hover { color: #ff4d4d; border-color: #ff4d4d; background: rgba(255, 77, 77, 0.05); transform: translateY(-2px); }

.utility-panel {
    margin-top: auto; 
    padding: 15px; 
    background: rgba(255,255,255,0.01);
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.03);
}

.utility-item { display: flex; justify-content: space-between; margin-bottom: 5px; }
.utility-header { font-size: 0.6rem; color: #333; font-family: 'Roboto Mono'; text-transform: uppercase; }
.temp-value, .volt-value { font-family: 'Roboto Mono'; font-size: 0.75rem; color: #666; }

.stats-update { animation: stats-glitch 0.3s ease-in-out; }

@keyframes stats-glitch {
    0% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.5; filter: brightness(2); }
    100% { opacity: 1; filter: brightness(1); }
}