/* Roundtable - Modern UI Styles */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Home Page */
.home-content {
    max-width: 700px;
    margin: 0 auto;
}

.question-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

textarea {
    resize: vertical;
}

/* Slider */
.slider-container {
    padding: 1rem 0;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.slider-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s, font-weight 0.2s;
}

.slider-label.active {
    color: var(--primary-color);
    font-weight: 600;
}

.slider-value {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn[data-enabled="false"] {
    background: var(--secondary-color);
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1.5rem;
}

.info-box strong {
    color: var(--primary-color);
}

.info-box ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.info-box li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

/* Advanced Options */
.advanced-options {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.advanced-options summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
}

.participant-picker {
    padding-top: 1rem;
}

/* Debate Page Layout */
.debate-container {
    max-width: 100%;
    padding: 1rem;
}

.debate-header {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-top h1 {
    font-size: 1.75rem;
    margin: 0;
}

.question-display {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.session-info {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.info-badge {
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-badge {
    font-weight: 600;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Debate Layout */
.debate-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    min-height: calc(100vh - 300px);
}

@media (max-width: 968px) {
    .debate-layout {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.transcript-panel,
.summary-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Transcript */
.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
}

.message.opening {
    border-left-color: var(--primary-color);
}

.message.turn {
    border-left-color: #8b5cf6;
}

.message.final-summary {
    border-left-color: var(--success-color);
    background: #f0fdf4;
}

.message.error {
    border-left-color: var(--error-color);
    background: #fef2f2;
}

.message-header {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-header strong {
    color: var(--text-primary);
}

.message-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.message-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Summary Panel */
.summary-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.summary-section {
    margin-bottom: 2rem;
}

.summary-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Consensus Meter */
.consensus-meter {
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
    text-align: center;
}

.meter-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.meter-status.success {
    color: var(--success-color);
}

.meter-status.pending {
    color: var(--warning-color);
}

/* Status Content */
.status-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Hotspots */
.hotspots-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hotspot-item {
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius);
    border-left: 3px solid var(--warning-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Text Utilities */
.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Scrollbar Styling */
.transcript-content::-webkit-scrollbar,
.summary-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track,
.summary-content::-webkit-scrollbar-track {
    background: var(--background);
}

.transcript-content::-webkit-scrollbar-thumb,
.summary-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover,
.summary-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

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

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Message Formatting */
.message-main {
    margin-bottom: 0.75rem;
}

.message-main p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.message-main p:last-child {
    margin-bottom: 0;
}

.message-metadata {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.meta-item strong {
    color: var(--text-secondary);
    font-weight: 600;
}
