/* AI 水獺 VTuber 測試面板樣式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3a3a5a;
}

header h1 {
    font-size: 1.5rem;
    color: #7dd3fc;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #4ade80;
    animation: none;
}

.status-dot.disconnected {
    background: #ef4444;
    animation: none;
}

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

/* Main Panels */
.panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
}

.panel {
    background: #1e1e3f;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #3a3a5a;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #252550;
    border-bottom: 1px solid #3a3a5a;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: #a5b4fc;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    background: #4b5563;
    color: white;
}

.btn-secondary:hover {
    background: #374151;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Chat Panel */
.chat-panel {
    grid-column: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: #6366f1;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background: #374151;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message.loading {
    background: #374151;
    color: #9ca3af;
}

.message.loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

.chat-input {
    display: flex;
    padding: 15px 20px;
    gap: 10px;
    background: #252550;
    border-top: 1px solid #3a3a5a;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #4b5563;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 1rem;
}

.chat-input input:focus {
    outline: none;
    border-color: #6366f1;
}

.chat-input button {
    padding: 12px 24px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.chat-input button:hover {
    background: #4f46e5;
}

.chat-input button:disabled {
    background: #4b5563;
    cursor: not-allowed;
}

/* Emotion Badge */
.emotion-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.emotion-badge.sarcastic { background: #f59e0b; color: #1a1a2e; }
.emotion-badge.caring { background: #ec4899; color: white; }
.emotion-badge.excited { background: #10b981; color: white; }
.emotion-badge.neutral { background: #6b7280; color: white; }
.emotion-badge.annoyed { background: #ef4444; color: white; }

/* Settings Panel */
.settings-panel {
    grid-column: 2;
}

.settings-content, .memory-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #a5b4fc;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.8rem;
}

.sub-group {
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid #3a3a5a;
}

.sub-group label {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Memory Panel */
.memory-panel {
    grid-column: 3;
}

.facts-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.fact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #252550;
    border-radius: 6px;
    margin-bottom: 6px;
}

.fact-item span {
    font-size: 0.9rem;
}

.fact-item .fact-date {
    color: #6b7280;
    font-size: 0.8rem;
}

.fact-item button {
    background: transparent;
    color: #ef4444;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.fact-item button:hover {
    background: #ef4444;
    color: white;
}

.add-fact {
    display: flex;
    gap: 8px;
}

.add-fact input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.add-fact button {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    font-weight: bold;
}

.add-fact button:hover {
    background: #059669;
}

/* Debug Section */
.debug-section {
    border-top: 1px solid #3a3a5a;
    margin-top: auto;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #252550;
    cursor: pointer;
}

.debug-header h3 {
    font-size: 0.9rem;
    color: #9ca3af;
}

.debug-header span {
    color: #6366f1;
    font-size: 0.85rem;
}

.debug-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 15px 20px;
    background: #0f0f1a;
    font-family: monospace;
    font-size: 0.8rem;
}

.log-entry {
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #252550;
}

.log-entry .log-time {
    color: #6b7280;
}

.log-entry .log-step {
    color: #10b981;
    margin: 0 8px;
}

.log-entry .log-detail {
    color: #e0e0e0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

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

    .memory-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .panels {
        grid-template-columns: 1fr;
        height: auto;
    }

    .panel {
        min-height: 400px;
    }
}
