/* General Styles */
* {
    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, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* Topic Input Section */
.topic-section {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.topic-input-container {
    max-width: 700px;
    margin: 0 auto 25px;
}

#topicInput {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

#topicInput:focus {
    outline: none;
    border-color: #667eea;
}

/* Model Selection */
.model-selection {
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: left;
}

.model-selection h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.15em;
    font-weight: 600;
}

.model-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.model-selector label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #374151;
}

.model-selector label strong {
    font-size: 0.95em;
    font-weight: 600;
}

.model-selector label small {
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.4;
}

.model-dropdown {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.model-dropdown:hover {
    border-color: #9ca3af;
}

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

/* Mode Selection */
.mode-selection {
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: left;
}

.mode-selection h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.15em;
    font-weight: 600;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    padding: 18px 20px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.mode-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #667eea;
}

.mode-option input[type="radio"]:checked {
    accent-color: #667eea;
}

.mode-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.mode-label strong {
    font-size: 1.05em;
    font-weight: 600;
    display: block;
}

.mode-label small {
    color: #6b7280;
    font-size: 0.9em;
    line-height: 1.5;
    display: block;
}

/* Panelist Selection */
.panelist-selection {
    max-width: 950px;
    margin: 0 auto 30px;
    padding: 25px;
    background: #f3f4f6;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.panelist-selection h3 {
    margin-bottom: 20px;
    color: #1f2937;
    text-align: center;
    font-size: 1.15em;
    font-weight: 600;
}

.panelist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-height: 450px;
    overflow-y: auto;
    padding: 10px 5px;
}

.panelist-card {
    background: white;
    border: 3px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panelist-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.panelist-card.selected {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.panelist-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.panelist-card.disabled:hover {
    border-color: #d1d5db;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panelist-card .checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: 2px solid #9ca3af;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s;
}

.panelist-card.selected .checkbox {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.panelist-card .checkbox::after {
    content: '✓';
    display: none;
    font-size: 18px;
    font-weight: bold;
}

.panelist-card.selected .checkbox::after {
    display: block;
}

.panelist-name {
    font-weight: 700;
    font-size: 1.15em;
    margin-bottom: 8px;
    color: #1f2937;
    padding-right: 40px;
    line-height: 1.3;
}

.panelist-affiliation {
    font-size: 0.9em;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 500;
}

.panelist-background {
    font-size: 0.875em;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 10px;
}

.panelist-interests {
    font-size: 0.8em;
    color: #6b7280;
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Start Button Container */
.start-button-container {
    text-align: center;
    margin: 20px 0;
}

.hint {
    color: #999;
    font-size: 0.9em;
    text-align: center;
    margin-top: 10px;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
}

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

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

.btn-icon {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn-icon:hover {
    opacity: 1;
}

/* Discussion Container */
.discussion-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.discussion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.discussion-header h2 {
    color: #667eea;
    font-size: 1.5em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

#statusText {
    font-size: 0.9em;
    color: #666;
}

/* Dual Pane Layout */
.panes-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.pane {
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.discussion-pane {
    flex: 3;
}

.debug-pane {
    flex: 1;
}

.pane-header {
    background: #667eea;
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-header h3 {
    font-size: 1em;
    font-weight: 600;
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Messages */
.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.timestamp {
    font-size: 0.8em;
    color: #999;
    margin-right: 8px;
}

.system-message {
    background: #e0e7ff;
    color: #4c51bf;
}

.moderator-message {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.panelist-message {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.debug-message {
    background: #f3f4f6;
    color: #4b5563;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.speaker {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

/* Review Controls */
.review-controls {
    background: #fff7ed;
    border: 2px solid #fdba74;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.review-message {
    margin-bottom: 20px;
}

.review-message strong {
    font-size: 1.2em;
    color: #ea580c;
    display: block;
    margin-bottom: 8px;
}

.review-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.review-buttons .btn {
    min-width: 150px;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 968px) {
    .panes-container {
        flex-direction: column;
    }

    .pane {
        height: 400px;
    }

    .topic-input-container {
        flex-direction: column;
    }

    .review-buttons {
        flex-direction: column;
    }

    .review-buttons .btn {
        width: 100%;
    }
}

/* Scrollbar Styles */
.pane-content::-webkit-scrollbar {
    width: 8px;
}

.pane-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pane-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.pane-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
    color: #333;
}

.modal-body p {
    margin-bottom: 1em;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
