:root {
    --bg-dark: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-card: rgba(255, 255, 255, 0.05);
    --accent: #d4af37;
    --accent-hover: #b8960c;
    --text-main: #f5f5f5;
    --text-dim: #888;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* Aesthetic Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Lora', serif;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .luxury-font {
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
    color: #f5f5f5;
}

/* Layout */
.lux-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-logo { height: 50px; filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3)); }

.menu-tabs { display: flex; gap: 30px; }
.tab-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}
.tab-link:hover, .tab-link.active { color: var(--accent); border-bottom-color: var(--accent); }

.main-content { padding: 40px 5%; max-width: 1400px; margin: 0 auto; }

/* Grid & Cards */
.cocktail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.cocktail-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.cocktail-card:hover { transform: translateY(-10px); border-color: var(--accent); background: rgba(255, 255, 255, 0.08); }

/* AI Bar */
.ai-bar-container {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 30px;
    height: calc(100vh - 180px);
    min-height: 600px;
}

.chat-box {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 80%;
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #1a1a2e;
    font-weight: 600;
    border-bottom-right-radius: 5px;
}
.message.assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom-left-radius: 5px;
}

.typing-indicator { display: flex; gap: 5px; padding: 5px 0; }
.typing-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: typing 1.4s infinite ease-in-out; opacity: 0.4; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-5px); opacity: 1; } }

.chat-input-area {
    padding: 25px;
    background: rgba(0,0,0,0.3);
    display: flex;
    gap: 15px;
}
.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 15px 25px;
    color: white;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s;
}
.chat-input-area input:focus { border-color: var(--accent); background: rgba(255,255,255,0.1); }

.recipe-preview {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

/* Inventory */
.inventory-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.inv-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-bottom: 15px;
    transition: all 0.3s;
}
.inv-item.inactive { opacity: 0.4; filter: grayscale(1); }

.toggle-btn {
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.toggle-btn.active { background: var(--accent); border-color: var(--accent); }
.toggle-btn::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toggle-btn.active::after { transform: translateX(24px); }

/* Buttons */
.btn-gold {
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #1a1a2e;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3); }

/* Edit Mode */
.edit-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent);
    border-radius: 12px;
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    font-family: inherit;
    outline: none;
}

/* Radar Chart (New) */
.radar-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}
.radar-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    cursor: crosshair;
}
.radar-labels {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.radar-label {
    position: absolute;
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .ai-bar-container { grid-template-columns: 1fr 350px; }
}
@media (max-width: 992px) {
    .ai-bar-container { grid-template-columns: 1fr; height: auto; }
    .recipe-preview { max-height: 600px; }
    .inventory-grid-container { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .lux-header { padding: 15px 5%; flex-direction: column; gap: 15px; }
    .menu-tabs { width: 100%; justify-content: center; gap: 15px; }
    .tab-link { font-size: 0.75rem; letter-spacing: 1px; }
    .header-right { display: none; }
    .main-content { padding: 25px 15px; }
    h1 { font-size: 2.2rem !important; }
    .cocktail-grid { grid-template-columns: 1fr; }
    .message { max-width: 90%; }
    .inventory-controls { flex-direction: column !important; gap: 15px !important; }
    .inventory-add-group { display: flex; flex-direction: column; gap: 10px; width: 100%; }
    .inventory-sub-group { display: flex; gap: 10px; width: 100%; }
    .inventory-sub-group select { flex: 1; }
    .btn-scan-mobile { width: 100%; margin-top: 5px; }
}
@media (max-width: 480px) {
    .chat-input-area { padding: 15px; }
    .chat-input-wrapper { gap: 8px !important; }
    .chat-input-area input { padding: 12px 20px !important; font-size: 0.9rem !important; }
    .chat-input-area button { width: 45px !important; height: 45px !important; }
    .inv-item { padding: 15px; }
}
