:root {
    --header-height: 60px;
    --color-bg-dark: #1b2735;
    --color-panel-dark: #202b38;
    --color-panel-darker: #162029;
    --color-border: #141b22;
    --color-accent: #4a67ff;
    --color-text-light: #e4ecff;
    --color-text-dim: #8aa0b8;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--color-bg-dark);
}

/* ================================
   HEADER
================================ */

header {
    height: var(--header-height);
    padding: 0 15px;
    background-color: var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #121a24;
}

#header-logo {
    height: 40px;
    object-fit: contain;
}

h1 {
    color: var(--color-text-light);
    margin: 0;
    padding-left: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 2.2rem;
}

/* ================================
   MAP + CHAT LAYOUT
================================ */

#layout {
    display: flex;
    width: 100%;
    height: calc(100vh - var(--header-height));
}

/* LEFT MAP AREA */
#map-container {
    flex: 4;
    position: relative;
}

#map {
    position: absolute;
    inset: 0;
}

/* ================================
   RIGHT CHAT PANEL
================================ */

#chat-panel {
    flex: 2;
    background: var(--color-bg-dark);
    border-left: 3px solid #121a24;
    display: flex;
    flex-direction: column;
    color: white;
}

#chat-header {
    background: #243447;
    padding: 12px;
    font-weight: bold;
    font-size: 17px;
    text-align: center;
    border-bottom: 1px solid #161d25;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Chat bubbles */
.chat-msg {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.3;
    font-size: 14px;
}

.chat-user {
    background: var(--color-accent);
    margin-left: auto;
}

.chat-bot {
    background: #2e3e55;
    margin-right: auto;
}

/* ================================
   CHAT INPUT
================================ */

#chat-input-box {
    padding: 10px;
    display: flex;
    background: #243447;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    outline: none;
    background: #1b2735;
    color: white;
}

#chat-send {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: var(--color-accent);
    color: white;
    cursor: pointer;
}

/* ================================
   MAP CONTROL BOX
================================ */

.box {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 999;
    padding: 14px;
    background: var(--color-panel-dark);
    color: var(--color-text-light);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    width: 230px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    font-family: 'Lato', sans-serif;
}

.box-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2d3640;
}

.box-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.box-title {
    font-size: 12px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.6px;
}

.box-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Buttons */
.pill-btn {
    padding: 6px 12px;
    font-size: 13px;
    background: #2c3e50;
    color: #dce7f7;
    border: 1px solid #273644;
    border-radius: 20px;
    cursor: pointer;
    transition: .15s ease;
}

.pill-btn:hover {
    background: #32475a;
    transform: translateY(-1px);
}

.pill-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

/* ================================
   LAYER MANAGER
================================ */

#layer-manager {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

#layer-select {
    flex: 1 1 auto;
    min-width: 0;
    background: #243447;
    color: white;
    border: 1px solid #2d3c4f;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
}


.layer-remove-btn {
    flex-shrink: 0;
    padding: 5px 8px;
    background: #aa3333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
}

.layer-remove-btn:hover {
    background: #cc4444;
}

/* ================================
   ZOOM WARNING
================================ */

#zoom-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 14px 22px;
    background: rgba(27, 39, 53, 0.92);
    color: white;
    border-radius: 10px;
    border: 1px solid #2d3c4f;
    font-size: 17px;
    z-index: 2000;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* ================================
   CHIPS — NUOVA UI MIGLIORATA
================================ */

#chat-suggestions-wrapper {
    padding: 14px;
    background: #1e2b39;
    border-bottom: 1px solid #162029;
}

#chat-suggestions-carousel {
    width: 100%;
}

#chat-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* ➜ DUE chips per riga */
    gap: 10px 10px; /* spazio righe / colonne */
    padding-bottom: 6px;
}

/* Responsive: sotto i 480px → 1 chip per riga */
@media (max-width: 480px) {
    #chat-suggestions {
        grid-template-columns: 1fr;
    }
}

/* Chip moderna */
.chat-chip {
    background: #263445;
    border: 1px solid #344556;
    padding: 12px;
    border-radius: 14px;
    color: #e1ebff;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    cursor: pointer;
    transition: 0.18s ease;
    user-select: none;
    width: 100%; /* ➜ si adatta alla colonna della griglia */
    text-align: left;
}

.chat-chip:hover {
    background: #2c3c50;
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(74,103,255,0.35);
    transform: translateY(-1px);
}

.chat-chip:active {
    transform: scale(0.97);
    background: #3b4f6b;
}


/* Messaggio "non disponibile da mobile" */
#mobile-message {
    display: none; /* nascosto di default su desktop */
    min-height: 100vh;
    padding: 24px;
    box-sizing: border-box;
}

.mobile-message-card {
    max-width: 480px;
    margin: 0 auto;
    margin-top: 10vh;
    background: #111827;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    color: #e5e7eb;
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.mobile-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.mobile-logo-wrap img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.45));
}

.mobile-message-card h1 {
    font-size: 1.8rem;
    margin: 0 0 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f9fafb;
}

.mobile-message-card p {
    margin: 0 0 10px;
    font-size: 0.98rem;
    line-height: 1.5;
}

.mobile-message-secondary {
    font-size: 0.9rem;
    color: #9ca3af;
}

@media (max-width: 768px) {
    header,
    #layout {
        display: none !important;
    }

    #mobile-message {
        display: flex;
        align-items: stretch;
        justify-content: center;
        background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
    }
}