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

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-overlay.hidden {
    display: none;
}

.login-box {
    background: var(--panel-bg);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-box h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.login-box input {
    width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-box button {
    width: 200px;
}

.login-error {
    color: var(--danger-color);
    margin-top: 10px;
    font-size: 0.9rem;
}

:root {
    --primary-color: #4a90d9;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --bg-color: #1a1a2e;
    --panel-bg: #16213e;
    --card-bg: #0f3460;
    --text-color: #e8e8e8;
    --text-muted: #a0a0a0;
    --border-color: #2a3f5f;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 5px;
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    height: calc(100vh - 150px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

/* Roles Panel */
.roles-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.roles-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.role-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.role-card:hover {
    border-color: var(--primary-color);
}

.role-card.selected {
    border-color: var(--success-color);
    background: rgba(39, 174, 96, 0.15);
}

.role-card .role-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.role-card .role-identity {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.role-card .role-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.role-card .role-actions button {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Meeting Controls */
.meeting-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meeting-controls {
    flex-shrink: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

.selected-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 6px;
}

.selected-role-tag {
    background: var(--primary-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

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

/* Discussion Panel */
.discussion-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.discussion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.discussion-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.round-indicator {
    background: var(--info-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.discussion-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    animation: fadeIn 0.3s ease;
}

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

.message.role {
    background: var(--card-bg);
    border-left: 4px solid var(--primary-color);
}

.message.moderator {
    background: rgba(243, 156, 18, 0.15);
    border-left: 4px solid var(--warning-color);
}

.message.system {
    background: rgba(52, 152, 219, 0.15);
    border-left: 4px solid var(--info-color);
    font-style: italic;
}

.message .message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.message .speaker-name {
    font-weight: bold;
    color: var(--primary-color);
}

.message.moderator .speaker-name {
    color: var(--warning-color);
}

.message .message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.message .message-content {
    line-height: 1.6;
    white-space: pre-wrap;
}

.message .typing-indicator {
    display: inline-block;
}

.message .typing-indicator::after {
    content: '...';
    animation: typing 1s infinite;
}

@keyframes typing {
    0%, 33% { content: '.'; }
    34%, 66% { content: '..'; }
    67%, 100% { content: '...'; }
}

.moderator-input {
    display: flex;
    gap: 10px;
}

.moderator-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-color);
}

.moderator-input input:focus {
    outline: none;
    border-color: var(--warning-color);
}

/* Summary Panel */
.summary-panel {
    max-height: 50%;
    display: flex;
    flex-direction: column;
}

.summary-container {
    flex: 1;
    overflow-y: auto;
    line-height: 1.6;
    max-height: 300px;
}

/* Consultation Log */
.consultation-item {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid var(--success-color);
}

.consultation-item .consultation-role {
    font-weight: bold;
    color: var(--success-color);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.consultation-item .consultation-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-color);
    max-height: 100px;
    overflow-y: auto;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

/* Meetings List */
.meetings-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.meetings-list {
    flex: 1;
    overflow-y: auto;
}

.meeting-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.meeting-item:hover {
    border-color: var(--primary-color);
}

.meeting-item .meeting-topic {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-item .meeting-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meeting-item .meeting-status.completed {
    color: var(--success-color);
}

.meeting-item .meeting-status.in_progress {
    color: var(--warning-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: #3a7bc8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #219a52;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d68910;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #2980b9;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #3a5070;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* MCP Server Config */
.mcp-server-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.mcp-server-item .mcp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mcp-server-item .mcp-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mcp-server-item input,
.mcp-server-item select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--panel-bg);
    color: var(--text-color);
    font-size: 0.9rem;
}

.mcp-server-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* Skill Item */
.skill-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.skill-item textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--panel-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-family: monospace;
    resize: vertical;
}

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

::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

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

    .sidebar {
        flex-direction: row;
    }

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