/* 🎨 TalkKing 시그니처 프리미엄 테마 정의 */
:root {
    --talkking-grad: linear-gradient(135deg, #6366f1, #4f46e5);
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #ffb900;
    --bg-main: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --chat-bg: #f8fafc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

body {
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* 대시보드 전체 레이아웃 */
.dashboard {
    width: 100vw;
    height: 100vh;
    background: var(--card-bg);
    display: flex;
    overflow: hidden;
}

@media (min-width: 1200px) {
    .dashboard {
        width: 1140px;
        height: 85vh;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
        border: 1px solid var(--border-color);
    }
}

/* 🗂️ 좌측 사이드바 */
.sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fafafa;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    background: var(--talkking-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.room-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
}

.room-item {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* 🤝 메인 본문 바디 구역 */
.chat-main-body {
    flex: 1;
    display: flex;
    background: var(--chat-bg);
}

/* 📬 중앙 대화창 뼈대 */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--chat-bg);
}

.chat-header {
    padding: 18px 24px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 👥 우측 멤버 현황판 */
.participant-sidebar {
    width: 220px;
    background: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.participant-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.participant-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.participant-item {
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

/* 💬 [세로 깨짐 방어] 말풍선 스타일 */
.msg {
    max-width: 65%;
    min-width: fit-content; 
    word-break: break-all;
    white-space: normal;    
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.msg.me {
    background: var(--talkking-grad);
    color: white;
    border-bottom-right-radius: 4px;
    text-align: left;
}

.msg.other {
    background: white;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.msg-sender {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

/* ⌨️ 하단 입력창 */
.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-area input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s;
}

.input-area input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 🔘 버튼 마스터 클래스 */
.btn {
    padding: 10px 16px;
    background: var(--talkking-grad);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-success { background: #10b981; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #e2e8f0; color: var(--text-main); }
.btn-secondary:hover { background: #cbd5e1; }

/* 🔔 푸시 알림 컨테이너 */
#toast-container {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 99999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    pointer-events: none !important;
}

.toast-notification {
    pointer-events: auto;
    background: #1e293b !important;
    color: #ffffff !important;
    padding: 16px 20px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15) !important;
    font-size: 14px !important;
    min-width: 300px !important;
    max-width: 380px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border-left: 4px solid #6366f1 !important;
    opacity: 0;
    transform: translateY(30px);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    to { opacity: 1; transform: translateY(0); }
}

/* 🔒 팝업 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 28px;
    border-radius: 20px;
    width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-main);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-box input, .modal-content .room-title-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: #f8fafc;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 18px;
    max-height: 220px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    background: #f8fafc;
}

.search-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    background: white;
    margin-bottom: 6px;
    border-radius: 8px;
}
.btn-sm {
    padding: 6px 12px !important;   /* 상하좌우 여백 축소 */
    font-size: 12px !important;     /* 글자 크기 다운 */
    border-radius: 8px !important;  /* 라운딩 값도 비율에 맞게 소폭 축소 */
    gap: 4px !important;
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }
.user-checkbox { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }