:root {
    --accent: #b45309; 
    --highlight: #fbbf24; 
    --bg-dark: #0f172a; 
    --panel-bg: rgba(30, 20, 10, 0.85); 
    --gold: #f59e0b;
    --border-color: #78350f;
    --text-main: #fef3c7;
    --gem-slot: #1a120b;
}
/* Language button styling matching checklist */
.translation-bar {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    display: flex; 
    gap: 8px; 
    z-index: 110;
}
.lang-btn {
    background: #1a120b;
    color: #fbbf24;
    border: 1px solid #78350f;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.2s;
}
.lang-btn.active {
    background: #b45309;
    color: white;
    border: 1px solid #fbbf24;
}
#fullscreen-btn {
    display: none; 
    background: none;
    border: 1px solid var(--highlight);
    color: var(--highlight);
    cursor: pointer;
    padding: 5px 15px; /* Added a bit more side padding */
    margin-right: 10px;
    
    /* New styles for alignment */
    display: flex;
    align-items: center;
    gap: 8px; /* Adds space between the icon and the text */
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

/* Optional: Make the icon slightly larger */
.btn-icon {
    font-size: 18px;
}

@media (min-width: 951px) {
    #fullscreen-btn {
        display: block;
    }
}

/* Windowed Fullscreen Layout */
.windowed-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    z-index: 9998 !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
}

/* Force chat-box to use all space */
.windowed-fullscreen #chat-box {
    flex-grow: 1 !important;
    height: 100% !important; 
    width: 100% !important;
    padding: 2vw !important; /* Scale padding with screen width */
    overflow-y: auto !important;
}

/* SCALE THE CONTENT: Use Viewport Units */
.windowed-fullscreen .message {
    max-width: 90% !important;
    width: 90% !important;
    line-height: 1.6 !important;
}

/* Force tables to be big and scalable */
.windowed-fullscreen .message table {
    width: 100% !important;
}

.windowed-fullscreen .message table td, 
.windowed-fullscreen .message table th {
    padding: 1vw !important; /* Scales cell size */
}

.windowed-fullscreen .input-area {
    width: 100% !important;
    box-sizing: border-box !important;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('https://shared.fastly.steamstatic.com/store_item_assets/steam/apps/4135880/aa91527899f964298f80e086dedfc4951a7fadb8/ss_aa91527899f964298f80e086dedfc4951a7fadb8.jpg?t=1777940920') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 50px; 
}

.title {
    width: 100%;
    text-align: center;
    padding: 30px 0;
    font-size: 32px;
    font-weight: bold;
    border-bottom: 4px solid var(--accent);
    background: rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-shadow: 0 0 10px var(--gold);
}

.chat-container {
    width: 90%; 
    max-width: 1000px; 
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 70vh; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    overflow: hidden;
    margin-bottom: 30px;
}

.chat-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-bottom: 2px solid var(--gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    margin: 0;
    color: var(--highlight);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#chat-box::-webkit-scrollbar { width: 8px; }
#chat-box::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.message {
    max-width: 85%;
    padding: 15px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    word-wrap: break-word;
}
/* Fix: Prevents tables inside messages from breaking the mobile screen */
.message table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.message img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer; /* Indicates it can be clicked */
    transition: transform 0.2s;
}

.message img:hover {
    transform: scale(1.02);
}

/* LIGHTBOX MODAL STYLES */
#image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#modal-img {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px var(--gold);
}

.alice-msg {
    align-self: flex-start;
    background: rgba(120, 53, 15, 0.2);
    border-left: 4px solid var(--gold);
}

.user-msg {
    align-self: flex-end;
    background: rgba(0, 0, 0, 0.4);
    border-right: 4px solid #00ffff;
    color: #E9E9EB;
}

.suggestion-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--gold);
    color: var(--highlight);
    padding: 8px;
    margin-top: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: 0.2s;
}

.suggestion-btn:hover {
    background: var(--accent);
    color: white;
}

.input-area {
    padding: 20px;
    background: rgba(0,0,0,0.4);
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

input[type="text"] {
    flex-grow: 1;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--accent);
    color: var(--highlight);
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background: var(--gem-slot);
    border: 1px solid var(--highlight);
    color: var(--highlight);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.2s;
}

button:hover {
    background: var(--accent);
    color: white;
}

.info-container {
    width: 100%;
    max-width: 1300px;
    padding: 0 20px;
}

.info-panel {
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.info-card {
    background: rgba(120, 53, 15, 0.1);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 6px;
}

.info-card h4 {
    margin: 0 0 10px 0;
    color: var(--highlight);
    text-transform: uppercase;
    font-size: 16px;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 5px;
}

.info-card p {
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    color: #e2e8f0;
}

.alice-name {
    color: var(--gold);
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
    display: block;
}

.back-btn-container {
    margin-bottom: 20px;
}
/* --- SIDEBAR & LAYOUT START --- */
.main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

.sidebar {
    flex: 1 1 240px;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.sidebar h3 {
    color: var(--highlight);
    text-transform: uppercase;
    font-size: 18px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-top: 0;
    text-align: center;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-nav button {
    width: 100%;
}

.main-content {
    flex: 3 1 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* MOBILE ONLY RULES (DOES NOT AFFECT PC) */
@media (max-width: 950px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin: 0;
    }

    /* CHAT WINDOW: Full width and height on phone */
    .chat-container {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        margin: 0 0 20px 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* IMAGE ON TOP: Only forces this on mobile */
    .message div[style*="display: flex"], 
    .message {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .message img {
        order: -1 !important; /* Image above text/table */
        width: 180px !important;
        max-width: 80% !important;
        height: auto !important;
        margin-bottom: 10px !important;
    }

    /* TABLE PROTECTION: Swipable on mobile so it doesn't go "OUT" */
    .message table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* SIDEBAR: Stays below the chat so you can scroll to it */
    .sidebar {
        width: 95% !important;
        order: 2;
        margin-bottom: 30px;
    }

.input-area {
        padding-bottom: 20px !important;
        flex-wrap: wrap; 
    }

    .input-area input[type="text"] {
        width: 100%;
        flex-basis: 100%;
    }

    .input-area button {
        flex-grow: 1;
    }
}
// ==================================== Sidebar & Layout End ====================================
// ==================================== Buttons & bottom page info ====================================
/* Smooth out transitions globally */
button, input, .info-card, .chat-container, .sidebar, .message img {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glowing pulse for the online indicator */
@keyframes statusPulse {
    0% { opacity: 0.6; text-shadow: 0 0 4px rgba(46, 204, 113, 0.4); }
    50% { opacity: 1; text-shadow: 0 0 12px rgba(46, 204, 113, 1); }
    100% { opacity: 0.6; text-shadow: 0 0 4px rgba(46, 204, 113, 0.4); }
}

#status-indicator {
    animation: statusPulse 2s infinite ease-in-out;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Micro-interactions for button hovers */
button:hover, .suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

button:active, .suggestion-btn:active {
    transform: translateY(1px);
}

/* Cross-browser scrollbars */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-dark);
}

/* Style table headers inside responses */
.message table th {
    background: rgba(120, 53, 15, 0.4) !important;
    color: var(--highlight);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Glow highlight for the input box when active */
input[type="text"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    background: rgba(0,0,0,0.8);
}
