* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 600px;
}

.config-panel {
    background: #f8f9fa;
    padding: 30px;
    border-right: 1px solid #e9ecef;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="range"] {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    padding: 0;
}

.slider-value {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    margin-top: 5px;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.chat-area {
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
}

.debate-header {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: none;
}

.debate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.llm-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.llm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
}

.llm-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.llm-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #e9ecef;
    color: #495057;
    font-size: 12px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #667eea;
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
    background: #fafbfc;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.message.llm-1-msg {
    justify-content: flex-start;
}

.message.llm-2-msg {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    background: #fff;
}

.message.llm-1-msg .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 6px;
}

.message.llm-2-msg .message-bubble {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message-header {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 600;
}

.message-content {
    font-size: 14px;
    white-space: pre-wrap;
}

.message-footer {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}

.loading {
    text-align: center;
    color: #6c757d;
    padding: 10px 20px 20px;
    font-style: italic;
}

.hidden {
    display: none !important;
}

.status-message {
    text-align: center;
    padding: 15px 20px;
    margin: 15px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95em;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    font-size: 12px;
    padding: 6px 12px;
    margin-top: 5px;
    border-radius: 10px;
}

.thinking-row {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
    align-items: center;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: #e9ecef;
    border-radius: 20px;
    animation: pulse 2s infinite;
    font-size: 12px;
}

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

.thinking-dots {
    display: flex;
    gap: 4px;
    margin-left: 6px;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.print-conversation {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
}

.print-conversation h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.print-turn {
    margin-bottom: 25px;
    padding: 15px;
    border-left: 3px solid #667eea;
    background: #f8f9fa;
    border-radius: 4px;
}

.print-turn-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #495057;
}

.print-turn-content {
    margin-left: 10px;
    white-space: pre-wrap;
}

.chat-status {
    border-top: 1px solid #e9ecef;
    background: #fdfdfe;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .config-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    .chat-messages {
        max-height: 50vh;
    }
}
