/* Playground Container */
.playground-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    height: calc(100vh - 70px);
    gap: 0;
    background: var(--light);
}

/* Config Sidebar */
.config-sidebar {
    background: white;
    padding: 30px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

.config-sidebar h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.5em;
}

.config-section {
    margin-bottom: 25px;
}

.config-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.select-field,
.input-field {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.select-field:focus,
.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

.help-text {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

.help-text a {
    color: var(--primary);
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
}

.theme-btn:hover {
    background: var(--light);
}

.theme-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.full-width {
    width: 100%;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-box h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-box p {
    font-size: 0.9em;
    line-height: 1.5;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    background: white;
    height: 100%;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--border);
    background: var(--light);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-title #current-model-emoji {
    font-size: 2em;
}

.chat-title h1 {
    font-size: 1.5em;
    color: var(--primary);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.message-content {
    max-width: 70%;
}

.message.user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-text {
    background: var(--light);
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.user .message-text {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot .message-text {
    border-bottom-left-radius: 5px;
}

.message.error .message-text {
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.message-time {
    font-size: 0.75em;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    gap: 5px;
    padding: 15px 20px;
    margin-left: 60px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 2px solid var(--border);
    padding: 20px 30px;
    background: var(--light);
}

.chat-input-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 25px;
    font-size: 1em;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    transition: border-color 0.3s;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.send-btn:active {
    transform: scale(0.95);
}

.input-help {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8em;
    color: #999;
}

kbd {
    background: white;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Examples Sidebar */
.examples-sidebar {
    background: white;
    padding: 30px;
    overflow-y: auto;
    border-left: 1px solid var(--border);
}

.examples-sidebar h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.5em;
}

.example-category {
    margin-bottom: 30px;
}

.example-category h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--text);
}

.example-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    line-height: 1.4;
}

.example-btn:hover {
    border-color: var(--primary);
    background: var(--light);
    transform: translateX(5px);
}

/* Stats Box */
.stats-box {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.stats-box h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1200px) {
    .playground-container {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .playground-container {
        grid-template-columns: 1fr;
    }
    
    .config-sidebar,
    .examples-sidebar {
        display: none;
    }
}
