/* AI 매개 Peer Support 채팅 프로토타입 스타일 */

/* 역할별 색상 변수 */
:root {
    --supporter-color: #3B82F6;
    --supporter-light: #DBEAFE;
    --seeker-color: #10B981;
    --seeker-light: #D1FAE5;
    --researcher-color: #8B5CF6;
    --researcher-light: #EDE9FE;
    --ai-color: #F59E0B;
    --ai-light: #FEF3C7;
}

/* 기본 스타일 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 역할 선택 버튼 스타일 */
.role-btn {
    display: flex;
    align-items: center;
    text-align: left;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.role-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.role-btn i {
    font-size: 1.5rem;
    width: 2rem;
    text-align: center;
}

/* 역할별 배지 스타일 */
.role-supporter {
    background-color: var(--supporter-color);
    color: white;
}

.role-seeker {
    background-color: var(--seeker-color);
    color: white;
}

.role-researcher {
    background-color: var(--researcher-color);
    color: white;
}

/* 메시지 버블 스타일 */
.message {
    max-width: 70%;
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease;
}

.message.own {
    margin-left: auto;
}

.message.other {
    margin-right: auto;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1.125rem;
    word-wrap: break-word;
    position: relative;
}

.message-info {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 역할별 메시지 스타일 */
.message-supporter.own .message-content {
    background-color: var(--supporter-color);
    color: white;
}

.message-supporter.other .message-content {
    background-color: var(--supporter-light);
    color: var(--supporter-color);
}

.message-seeker.own .message-content {
    background-color: var(--seeker-color);
    color: white;
}

.message-seeker.other .message-content {
    background-color: var(--seeker-light);
    color: var(--seeker-color);
}

.message-ai .message-content {
    background-color: var(--ai-light);
    color: var(--ai-color);
    border: 2px solid var(--ai-color);
    position: relative;
}

.message-ai .message-content::before {
    content: '🤖';
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    background: var(--ai-color);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* 시스템 메시지 스타일 */
.message-system {
    text-align: center;
    color: #6B7280;
    font-style: italic;
    font-size: 0.875rem;
    margin: 1rem auto;
    max-width: none;
}

.message-system .message-content {
    background-color: #F3F4F6;
    color: #6B7280;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    display: inline-block;
}

/* 온라인 상태 표시 */
.online-indicator {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #10B981;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.25rem;
    animation: pulse 2s infinite;
}

.offline-indicator {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #EF4444;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.25rem;
}

/* 세션 카드 스타일 */
.session-card {
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-card:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.session-card.active {
    background-color: var(--researcher-light);
    border-color: var(--researcher-color);
}

/* 연구자 대시보드 스타일 */
#researcherDashboard {
    border-left: 2px solid var(--researcher-color);
}

#monitorMessages {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.monitor-message {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    border-left: 3px solid transparent;
}

.monitor-message.supporter {
    background-color: var(--supporter-light);
    border-left-color: var(--supporter-color);
}

.monitor-message.seeker {
    background-color: var(--seeker-light);
    border-left-color: var(--seeker-color);
}

.monitor-message.ai {
    background-color: var(--ai-light);
    border-left-color: var(--ai-color);
}

/* 토스트 알림 스타일 */
.toast-success {
    border-left: 4px solid #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-warning {
    border-left: 4px solid #F59E0B;
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 스크롤바 스타일 */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E0 #F7FAFC;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #F7FAFC;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #CBD5E0;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: #A0AEC0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    #researcherDashboard {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 40;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    #researcherDashboard.show {
        transform: translateX(0);
    }
    
    .message {
        max-width: 85%;
    }
    
    #roleSelectionModal .bg-white {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .message {
        max-width: 95%;
    }
    
    #messageInputArea {
        padding: 0.75rem;
    }
    
    #messageInput {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    #sendBtn {
        padding: 0.75rem 1rem;
    }
}

/* 접근성 개선 */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .message-content {
        border: 1px solid currentColor;
    }
    
    .message-ai .message-content {
        border-width: 2px;
    }
}

/* 다크 모드 지원 (옵션) */
@media (prefers-color-scheme: dark) {
    :root {
        --supporter-color: #60A5FA;
        --supporter-light: #1E3A8A;
        --seeker-color: #34D399;
        --seeker-light: #064E3B;
        --researcher-color: #A78BFA;
        --researcher-light: #4C1D95;
        --ai-color: #FBBF24;
        --ai-light: #92400E;
    }
}

/* 입력 필드 포커스 효과 */
.input-focus:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 버튼 호버 효과 */
.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 로딩 스피너 */
.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3B82F6;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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