:root {
    --bg-main: #0a0a0f;
    --bg-darker: #07070a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --accent: #5923d9;
    --accent-hover: #7c4dff;
    --gradient-primary: linear-gradient(135deg, #5923d9 0%, #7c4dff 100%);
    --accent-rgb: 89, 35, 217;
    --accent-hover-rgb: 124, 77, 255;
    --text-primary: #ffffff;
    --text-secondary: #b8b8cc;
    --text-muted: #7a7a8a;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(89, 35, 217, 0.3);
    --success: #00d4aa;
    --warning: #ffb020;
    --danger: #ff4757;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 64px rgba(0, 0, 0, 0.4);
}
.page-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.playground-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gradient-title {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    font-weight: 700;
}
.chat-area-main {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-main);
}
.chat-main-layout {
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-main, #101014);
    margin: 0 !important;
    padding: 0 !important;
}

.chat-content-area {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    background: transparent;
}

.chat-container.chat-modern {
    margin: 0 auto !important;
    align-self: center !important;
    justify-self: center !important;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

@media (max-width: 600px), (max-height: 500px) {
    .chat-main-layout, .chat-content-area {
        min-height: 100vh;
        height: 100vh;
        padding: 0 !important;
    }
    .chat-container.chat-modern {
        width: 99vw;
        height: 99vh;
        min-width: 0;
        min-height: 0;
        max-width: 99vw;
        max-height: 99vh;
        border-radius: 0;
    }
}
.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2rem 1.5rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

@media (max-width: 800px) {
    .chat-messages {
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
}
.bubble {
    border-radius: 16px;
    padding: 0.45rem 0.85rem;
    max-width: 54%;
    font-size: 1.01rem;
    margin: 0.08rem 0;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    word-break: break-word;
    white-space: pre-line;
}
.bubble.user {
    background: linear-gradient(135deg, #7c4dff 0%, #5923d9 100%);
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
    border-radius: 16px 16px 6px 16px;
    box-shadow: 0 2px 8px rgba(89,35,217,0.08);
    padding: 0.45rem 0.85rem;
    max-width: 54%;
    font-size: 1.01rem;
}
.bubble.bot {
    background: #23232a;
    color: #ececf1;
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
    border-radius: 16px 16px 16px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #343541;
    padding: 0.45rem 0.85rem;
    max-width: 54%;
    font-size: 1.01rem;
}
@media (max-width: 900px) {
    .bubble {
        max-width: 90%;
    }
}
.chat-input {
    display: flex;
    gap: 0.7rem;
    padding: 1.2rem 1.5rem 1.2rem 1.5rem;
    background: transparent;
    border-top: 1px solid #23232a;
    position: sticky;
    bottom: 0;
    z-index: 2;
}
@media (max-width: 800px) {
    .chat-input {
        padding: 0.7rem 0.5rem 0.7rem 0.5rem;
    }
}

#user-input {
    flex: 1;
    border-radius: 12px;
    border: none;
    padding: 0.9rem 1.1rem;
    background: #18181b;
    color: #fff;
    font-size: 1.05rem;
    outline: none;
}
.chat-input button[type="submit"] {
    background: linear-gradient(90deg, #7c4dff 0%, #5923d9 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input button[type="submit"]:hover {
    background: linear-gradient(90deg, #5923d9 0%, #7c4dff 100%);
}
#image-preview img {
    max-width: 180px;
    max-height: 180px;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0002;
}
.chat-card {
    padding: 0 !important;
}
.chat-content-area {
    overflow: visible !important;
}
.message-row {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
    margin-bottom: 0.7rem;
}

.message-row.user {
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-right: 2.5vw;
}

.message-row.bot {
    justify-content: flex-start;
    margin-left: 2.5vw;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
    flex-shrink: 0;
}

.bubble {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    max-width: 70%;
    position: relative;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    word-break: break-word;
}

.bubble.user {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    margin-left: auto;
}

.bubble.bot {
    background: var(--bg-card);
    color: var(--text-primary);
    margin-right: auto;
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: block;
}
.input-container {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: relative;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

#user-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
    min-height: 24px;
    padding: 0;
}

#user-input:focus {
    outline: none;
}

#user-input::placeholder {
    color: var(--text-muted);
}

.upload-button,
.record-button,
.send-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-button:hover,
.record-button:hover,
.send-button:hover {
    color: var(--accent);
    background: var(--bg-card);
}

.record-button.recording {
    color: var(--danger);
    animation: pulse 2s infinite;
}

.recording-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recording-indicator i {
    animation: pulse 1s infinite;
}
.agent-dropdown {
    position: relative;
}

.agent-active-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agent-active-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.agent-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.agent-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.agent-option:hover {
    background: var(--bg-card-hover);
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}
@media (max-width: 768px) {
    .playground-header {
        padding: 1rem;
    }

    .chat-container {
        padding: 1rem;
    }

    .bubble {
        max-width: 90%;
    }

    .input-container {
        padding: 1rem;
    }

    .input-wrapper {
        padding: 0.5rem;
    }
}

@media (max-width: 700px) {
    .bubble {
        max-width: 90%;
        padding: 0.7rem 1rem;
    }
    .message-row.user {
        margin-right: 1vw;
    }
    .message-row.bot {
        margin-left: 1vw;
    }
}

@media (max-width: 900px) {
    .chat-content-area {
        padding-left: 0;
        align-items: stretch;
    }
    .chat-container {
        max-width: 100vw;
        width: 100vw;
        padding: 1rem 0.2rem;
        height: 100%;
    }
}
.chatlog-entry-title {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.chatlog-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #18181b 0%, #101014 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
    border-right: none;
    position: fixed;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    z-index: 102;
    box-shadow: 0 2px 16px rgba(0,0,0,0.13);
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1), background 0.2s;
    overflow: hidden;
}

.sidebar-topbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 20px 16px 12px 16px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #ececf1;
    background: transparent;
    border-bottom: none;
    letter-spacing: 0.04em;
    position: relative;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #ececf1;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 0.7rem;
    border-radius: 6px;
    padding: 6px 10px;
    transition: background 0.18s, color 0.18s;
    outline: none;
    z-index: 110;
}
.sidebar-toggle-btn:hover {
    background: #23232a;
    color: #fff;
}

.chatlog-sidebar.minimized {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}
.chatlog-sidebar.minimized .sidebar-topbar,
.chatlog-sidebar.minimized .sidebar-separator,
.chatlog-sidebar.minimized .chatlog-list,
.chatlog-sidebar.minimized .sidebar-footer,
.chatlog-sidebar.minimized .new-chat-btn {
    display: none !important;
}
.chatlog-sidebar.minimized .sidebar-toggle-btn {
    display: block !important;
    margin: 0 auto;
    position: absolute;
    left: 0; right: 0; top: 18px;
    z-index: 120;
}

.sidebar-separator {
    height: 1px;
    background: #23232a;
    margin: 0 16px 12px 16px;
    border: none;
}

.chatlog-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 0 8px;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #343541 #18181b;
    background: transparent;
}

.chatlog-entry {
    color: #ececf1;
    padding: 13px 12px;
    border-radius: 7px;
    cursor: pointer;
    margin-bottom: 4px;
    font-size: 1rem;
    font-family: 'Segoe UI', 'Inter', Arial, sans-serif;
    font-weight: 400;
    background: none;
    border: none;
    transition: background 0.13s, color 0.13s;
    outline: none;
    user-select: none;
    min-height: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chatlog-entry:hover, .chatlog-entry.active {
    background: #23232a;
    color: #fff;
}

.sidebar-footer {
    padding: 16px 16px;
    color: #8e8ea0;
    font-size: 0.93rem;
    background: transparent;
    text-align: left;
    border-top: none;
    margin-top: auto;
    opacity: 0.7;
}

@media (max-width: 900px) {
    .chatlog-sidebar {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        border-right: none;
        border-bottom: none;
        flex-direction: row;
        height: 60px;
        align-items: center;
        overflow-x: auto;
        box-shadow: none;
        background: #202123;
        left: 0;
        top: 0;
        padding: 0;
    }
    .sidebar-topbar, .sidebar-separator, .sidebar-footer {
        display: none;
    }
    .new-chat-btn {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 10px 0 10px 10px;
    }
    .chatlog-list {
        padding: 0;
    }
    .chatlog-sidebar.minimized {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }
} 