/**
 * 토론방 스타일 - 채팅 + 오른쪽 사이드바 레이아웃
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f5f7fa;
    color: #1a1a1a;
}

.container {
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

/* ========================================== 헤더 ========================================== */
.room-header {
    background: #4a90e2;
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255,255,255,0.95);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-icon:hover {
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: scale(1.1);
}

.header-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.btn-close {
    background: rgba(255,255,255,0.95);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-close:hover {
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: scale(1.1);
}

/* ========================================== 토론 상황 ========================================== */
.discussion-context {
    background: #fff9e6;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    user-select: none;
}

.context-header:hover {
    background: rgba(74, 144, 226, 0.05);
}

.context-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.context-icon {
    font-size: 1.1rem;
}

.context-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.context-toggle:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.context-toggle.collapsed .toggle-icon {
    transform: rotate(90deg);
}

.context-content {
    padding: 0.5rem 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.context-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

#contextDescription {
    color: #444;
    line-height: 1.4;
    font-size: 0.925rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ========================================== 메인 레이아웃 ========================================== */
.main-layout {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* 채팅 영역 (왼쪽, 항상 표시) */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 메시지 영역 */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #E8F3FA;  /* 연한 하늘색 배경 */
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

/* 메시지 스타일 - 카카오톡 스타일 */
.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.2s ease-in;
    max-width: 80%;
}

/* 타인의 메시지 (좌측 정렬) */
.message.message-other {
    align-self: flex-start;
    flex-direction: row;
}

/* 내 메시지 (우측 정렬) */
.message.message-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

/* 내 메시지일 때 헤더 숨김 */
.message.message-own .message-header {
    display: none;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1a1a1a;
}

.message-role {
    font-size: 0.75rem;
    color: #666;
    background: #e5e7eb;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    align-self: flex-end;
    margin-top: 0.25rem;
}

/* 타인 메시지 말풍선 - 흰색 */
.message.message-other .message-text {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
    line-height: 1.5;
}

/* 내 메시지 말풍선 - 파란색 */
.message.message-own .message-text {
    background: #4A90E2;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px 0 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
    line-height: 1.5;
}

.system-message {
    text-align: center;
    padding: 0.5rem;
    color: #666;
    font-size: 0.875rem;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}

/* 메시지 입력 */
.message-input-container {
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 1rem;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.btn-voice {
    background: white;
    color: #4a90e2;
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.btn-voice:hover {
    background: #f9fafb;
    border-color: #4a90e2;
}

.btn-voice.recording {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse-voice {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.voice-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.btn-send {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #357abd;
}

.send-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* ========================================== 사이드바 (오른쪽, 토글) ========================================== */
.sidebar {
    flex-basis: 0;
    width: 0;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    overflow: hidden;
    transition: flex-basis 0.3s ease-in-out, width 0.3s ease-in-out;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

.sidebar.active {
    flex-basis: 600px;
    width: 600px;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-sidebar:hover {
    background: #e5e7eb;
}

.sidebar-close-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-panel {
    padding: 1rem;
}

/* 참여자 목록 */
.participants-header {
    margin-bottom: 1rem;
}

.participant-stats {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90e2;
}

.participants-list {
    margin-bottom: 1rem;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.participant-item:hover {
    background: #f9fafb;
}

.participant-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}

.participant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.participant-role {
    font-size: 0.75rem;
    color: #666;
}

.participant-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
}

.participant-status.offline {
    background: #9ca3af;
}

.participants-stats {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.role-stats {
    display: flex;
    justify-content: space-around;
}

.role-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.role-label {
    font-size: 0.75rem;
    color: #666;
}

.role-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4a90e2;
}

/* AI 분석 */
.analysis-header {
    margin-bottom: 1rem;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: #f3f4f6;
}

.analysis-section {
    margin-bottom: 1.5rem;
}

.analysis-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.summary-box {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    line-height: 1.6;
}

/* AI 질문 */
.questions-header {
    margin-bottom: 1rem;
}

.timer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.timer-label {
    font-size: 0.75rem;
    color: #666;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90e2;
}

/* 공통 */
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ========================================== 하단 버튼 영역 ========================================== */
.bottom-actions {
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 0.75rem;
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #4a90e2;
}

.action-btn.active {
    background: #eff6ff;
    color: #4a90e2;
}

.action-btn .btn-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.btn-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.btn-badge {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

/* ========================================== 모달 ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 1.5rem;
}

.share-section {
    margin-bottom: 1.5rem;
}

.share-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
}

.url-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.url-input-group button {
    padding: 0.75rem 1.5rem;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* ========================================== 반응형 ========================================== */
@media (max-width: 768px) {
    .sidebar.active {
        flex-basis: 100%;
        width: 100%;
        max-width: 100vw;
    }

    .btn-label {
        display: none;
    }

    .action-btn {
        padding: 0.5rem;
    }
}

/* ========================================== AI 질문 스타일 ========================================== */
.loading-state {
    padding: 2rem 1rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.error-state {
    padding: 2rem 1rem;
    text-align: center;
    color: #ef4444;
}

.questions-header-actions {
    margin-bottom: 1rem;
}

.btn-generate-questions {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-generate-questions:hover {
    background: #357abd;
}

.questions-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.question-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.question-number {
    background: #4a90e2;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.question-category {
    background: #e5e7eb;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.question-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.question-footer {
    display: flex;
    justify-content: flex-end;
}

.question-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ========================================== AI 메시지 스타일 ========================================== */
/* AI 메시지 - 우아한 라벤더 그라데이션 */
.message.message-ai {
    max-width: 85%;
    align-self: flex-start;
}

.message.message-ai .message-avatar {
    background: transparent;
    border-radius: 50%;
}

.message.message-ai .message-author {
    color: #7C3AED;
    font-weight: 700;
}

.message.message-ai .message-role {
    background: #EDE9FE;
    color: #7C3AED;
    font-weight: 600;
}

.message.message-ai .message-text {
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    color: #1F2937;
    padding: 1rem 1.25rem;
    border-radius: 0 16px 16px 16px;
    box-shadow: 0 3px 10px rgba(167, 139, 250, 0.4);
    font-weight: 500;
}

/* ========================================== AI 질문 타이머 ========================================== */
.btn-timer {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
    }
}

.action-btn {
    position: relative;
}

/* ========================================== 역할 색상 스타일 ========================================== */
.role-pros {
    color: #3b82f6; /* Blue for 찬성 */
    font-weight: 600;
}

.role-cons {
    color: #ef4444; /* Red for 반대 */
    font-weight: 600;
}

.role-neutral {
    color: #6b7280; /* Gray for neutral */
    font-weight: 500;
}

.participant-role.role-pros {
    color: #3b82f6;
}

.participant-role.role-cons {
    color: #ef4444;
}

.participant-role.role-neutral {
    color: #6b7280;
}

.message-role.role-pros {
    color: #3b82f6;
}

.message-role.role-cons {
    color: #ef4444;
}

.message-role.role-neutral {
    color: #6b7280;
}

/* ========================================== 입장 모달 스타일 ========================================== */
.join-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.join-modal-box {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
}

.join-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.join-modal-close:hover {
    color: #374151;
}

.join-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin: 0 0 0.75rem 0;
}

.join-modal-description {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.join-modal-field {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.join-modal-label {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    min-width: 80px;
}

.join-modal-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}

.join-modal-input:focus {
    border-color: #60a5fa;
}

.join-modal-input::placeholder {
    color: #9ca3af;
}

.join-modal-radio-group {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.join-modal-radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.join-modal-radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #60a5fa;
}

.join-modal-radio-item label {
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.join-modal-button {
    width: 100%;
    padding: 0.875rem;
    background: #93c5fd;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.join-modal-button:hover {
    background: #60a5fa;
}

.join-modal-button:active {
    background: #3b82f6;
}

/* ========================================== AI 분석 패널 스타일 ========================================== */

/* AI 분석 탭 */
.analysis-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f9fafb;
    border-color: #4a90e2;
    color: #4a90e2;
}

.tab-btn.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
    font-weight: 600;
}

/* 탭 컨텐츠 */
.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* 분석 소개 */
.analysis-intro {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 3px solid #4a90e2;
}

.analysis-intro p {
    margin: 0;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 분석 시작 뷰 */
#analysis-start-view {
    text-align: center;
    padding: 2rem 0;
}

.btn-start-analysis {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-start-analysis:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-start-analysis span:first-child {
    font-size: 1.25rem;
}

.analysis-hint {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 로딩 상태 */
#analysis-loading-view {
    text-align: center;
    padding: 2rem 0;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #e5e7eb;
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.skeleton-box {
    height: 120px;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 분석 결과 섹션 */
.result-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* AI 최종 판정 */
.verdict-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.winner-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: #4a90e2;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.verdict-text {
    margin: 0;
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* 팀별 분석 */
.team-analysis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-box {
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 4px solid;
}

.team-box.team-pros {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
}

.team-box.team-cons {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
}

.team-header {
    margin-bottom: 0.75rem;
}

.team-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
}

.pros-badge {
    background: #3b82f6;
    color: white;
}

.cons-badge {
    background: #ef4444;
    color: white;
}

.team-content p {
    margin: 0.5rem 0;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.team-content strong {
    font-weight: 600;
}

/* 주요 발언 */
.key-statements {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.statement-box {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.statement-box.statement-pros {
    background: #eff6ff;
    border-color: #3b82f6;
}

.statement-box.statement-cons {
    background: #fef2f2;
    border-color: #ef4444;
}

.statement-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.statement-text {
    margin: 0;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.6;
    font-style: italic;
}

/* 참여자 개별 분석 */
.participants-analysis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.participant-analysis-box {
    padding: 1.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.participant-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.participant-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.participant-team-badge {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.participant-analysis-content {
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.participant-analysis-content p {
    margin: 0.5rem 0;
}

.contribution-highlight {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fef9c3;
    border-left: 3px solid #eab308;
    border-radius: 4px;
    font-style: italic;
}

/* 분석 액션 버튼 */
.analysis-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary, .btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: white;
    color: #4a90e2;
    border: 1px solid #4a90e2;
}

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

.btn-primary {
    background: #5b8def;
    color: white;
    box-shadow: 0 2px 8px rgba(91, 141, 239, 0.3);
}

.btn-primary:hover {
    background: #4a7ce0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.4);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

/* ========================================== 흐름 시각화 탭 ========================================== */

.flow-intro {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    border-bottom: 1px solid #e5e7eb;
}

.flow-section {
    margin: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.flow-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flow-timeline-ai {
    max-height: 400px;
    overflow-y: auto;
}

.timeline-moment {
    position: relative;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
}

.timeline-moment:last-child {
    margin-bottom: 0;
}

.timeline-moment-time {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.timeline-moment-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.timeline-moment-description {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

.charts-container {
    padding: 2rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.chart-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.chart-section.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-section.full-width .chart-wrapper {
    height: 350px;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-section.full-width {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .charts-container {
        padding: 1rem;
    }

    .chart-wrapper {
        height: 250px;
    }

    .chart-section.full-width .chart-wrapper {
        height: 280px;
    }
}

/* ========================================== AI 판결문 탭 ========================================== */

.verdict-intro {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.btn-start-verdict {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-start-verdict:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.verdict-hint {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
}

.verdict-document {
    padding: 2rem;
    background: white;
    border: 2px solid #1f2937;
    border-radius: 8px;
    margin: 1rem;
}

.verdict-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 3px double #1f2937;
    margin-bottom: 2rem;
}

.verdict-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    margin-bottom: 1rem;
    color: #1f2937;
}

.verdict-subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.verdict-major-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.verdict-major-section:last-child {
    border-bottom: none;
}

.major-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px double #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.major-section-title span {
    font-size: 1.75rem;
}

.verdict-section {
    margin-bottom: 2.5rem;
}

.verdict-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.verdict-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.verdict-subsection {
    margin-top: 1.5rem;
    margin-left: 1.5rem;
}

.verdict-subsection h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.verdict-section p,
.verdict-subsection p {
    line-height: 2;
    color: #1f2937;
    text-align: justify;
    font-size: 1rem;
}

.verdict-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.verdict-footer p {
    margin: 0.5rem 0;
    color: #1f2937;
}

.verdict-sign {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
}

.verdict-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.verdict-actions button {
    flex: 1;
}

/* URL 복사 그룹 레이아웃 */
.url-copy-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.url-copy-group input {
    flex: 1;
}

/* 복사 버튼 기본 스타일 */
.btn-copy {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background-color: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    background-color: #e0e0e0;
}

/* 공유 모달 복사 버튼 - 별칭 확인과 동일한 디자인 */
.btn-copy-primary {
    background-color: white !important;
    color: #6b7280 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.btn-copy-primary:hover {
    background-color: #fef9c3 !important;
    border-color: #fde68a !important;
}

.btn-copy-primary:active {
    transform: scale(0.95);
}

.btn-copy-primary i,
.btn-copy-primary img {
    width: 16px;
    height: 16px;
}

/* QR 코드 섹션 여백 */
.qr-section {
    text-align: center;
    margin-bottom: 28px;
}

/* QR 코드 컨테이너 가운데 정렬 */
.modal-content #shareQrCode {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: inline-block;
    background: white;
    margin: 20px auto;
}

/* QR 코드를 담고 있는 영역 가운데 정렬 */
.modal-content > p:first-of-type {
    text-align: center;
    margin: 20px 0;
}

/* 사용자 지정 URL 그룹 */
.custom-url-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 사용자 지정 URL 입력창 - 파란색 테두리 */
.custom-alias {
    flex: 1;
    border: 2px solid #5b8def !important;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
    height: 40px;
}

.custom-alias:focus {
    outline: none;
    border-color: #4a7ce0 !important;
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.1);
}

/* 도메인 선택 드롭다운 */
.custom-url-group .form-select {
    width: auto;
    min-width: 100px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
}

/* 체크 버튼 - 흰색 배경 + 회색 체크 + 노란색 hover */
.btn-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background-color: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-check:hover {
    background-color: #fef9c3;
    border-color: #fde68a;
}

.btn-check:active {
    transform: scale(0.95);
}

.btn-check i {
    font-size: 16px;
}

/* 단축 URL 생성 버튼 - 전체 너비, 원본: 40px */
#shareModal .btn-primary {
    width: 100%;
    border-radius: 6px;
    padding: 8px 16px;
    min-height: 40px;
    height: 40px;
    font-size: 14px;
    font-weight: 500;
}

/* 공유 모달 form-group 여백 조정 */
#shareModal .form-group {
    margin-bottom: 20px;
}

#shareModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

/* 공유 모달 입력창 높이 조정 - 원본: 40px */
#shareModal .form-input {
    padding: 8px 12px;
    min-height: 40px;
    height: 40px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

#shareModal .form-select {
    padding: 8px 12px;
    min-height: 40px;
    height: 40px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* 결과 섹션 상단 여백 */
#shareResult {
    margin-top: 24px;
}

/* 공유하기 버튼 상단 여백 - 원본: 40px */
#shareModal .btn-secondary {
    margin-top: 16px;
    background-color: #5b8def !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    min-height: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

#shareModal .btn-secondary:hover {
    background-color: #4a7ce0 !important;
}

/* ========================================== 모달 닫기 버튼 통일 (로비와 동일) ========================================== */
.modal-close {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.modal-close:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

/* 공유 모달 닫기 버튼 강제 적용 */
#shareModal .modal-close,
#shareModal button.modal-close {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

#shareModal .modal-close:hover,
#shareModal button.modal-close:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

/* ========================================== Toast Notification (로비와 동일) ========================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 16px;
}

.toast-message {
    font-size: 14px;
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

