/* ChatGPT Style Premium Layout CSS */

:root {
    --sidebar-bg: #171717;
    --sidebar-hover: #212121;
    --main-bg: #212121;
    --text-primary: #ececec;
    --text-muted: #b4b4b4;
    --accent-color: #3d3d3d;
    --active-item-bg: #212121;
}

.chat-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--main-bg);
    color: var(--text-primary);
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 12px;
}

.new-chat-btn {
    width: 100% !important;
    justify-content: flex-start !important;
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
    transition: background 0.2s;
}

.new-chat-btn:hover {
    background-color: var(--sidebar-hover) !important;
}

.history-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.history-group {
    margin-bottom: 24px;
}

.history-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
    display: block;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    background-color: var(--sidebar-hover);
}

.history-item.active {
    background-color: var(--active-item-bg);
}

.history-item .k-icon {
    margin-right: 12px;
    color: var(--text-muted);
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.body-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: transparent;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: var(--sidebar-hover);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 11px;
    color: var(--text-muted);
}

.settings-btn {
    color: var(--text-muted) !important;
    padding: 4px !important;
}

.settings-btn:hover {
    color: var(--text-primary) !important;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 8px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: thinking-bounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.3; } 
    40% { transform: scale(1); opacity: 1; }
}