/* chat.css - 나는SOLO 실시간 채팅 스타일 */

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

body {
    font-family: 'Malgun Gothic', sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== 사이트 헤더 ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    flex-shrink: 0;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.site-nav a {
    color: #666;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}

/* ===== 채팅 컨테이너 ===== */
.nasolo-chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ===== 나솔 헤더 ===== */
.nasolo-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 13px;
}

.nasolo-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name {
    font-weight: 600;
    white-space: nowrap;
}

.online-count {
    white-space: nowrap;
    opacity: 0.9;
}

/* ===== 방송 상태 배지 ===== */
.broadcast-status {
    display: inline-flex;
    align-items: center;
    color: #ff4444;
    font-size: 18px;
    animation: pulse 2s infinite;
    flex-shrink: 0;
    line-height: 1;
}

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

/* ===== 채팅 래퍼 ===== */
.chat-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ===== 채팅 메시지 영역 ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

/* ===== 메시지 ===== */
.message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
    padding: 10px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.03);
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.message-author {
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    color: #999;
}

/* ===== 메시지 반응 버튼 ===== */
.message-reactions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reaction-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: 12px;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: rgba(0,0,0,0.05);
}

.reaction-btn.active {
    background: rgba(102, 126, 234, 0.1);
}

.reaction-count {
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

.reaction-btn.like-btn.active .reaction-count {
    color: #28a745;
}

.reaction-btn.dislike-btn.active .reaction-count {
    color: #dc3545;
}

.reaction-btn.warn-btn.active .reaction-count {
    color: #ffc107;
}

/* ===== 메시지 내용 ===== */
.message-content {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.5;
}

/* ===== 내 메시지 ===== */
.message.my-message .message-author {
    color: #764ba2;
}

.message.my-message {
    background: rgba(118, 75, 162, 0.05);
}

.message.my-message .message-content {
    background: #f0e7ff;
}

/* ===== 블라인드 메시지 ===== */
.message.blinded .message-content {
    background: transparent;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.blind-notice {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    color: #dc3545;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blind-notice::before {
    content: '🚫';
    font-size: 14px;
}

.blind-admin-btn {
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.blind-admin-btn:hover {
    background: #5568d3;
}

.blind-original-content {
    display: none;
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.blind-original-content.show {
    display: block;
}

/* ===== 출연자 선택 영역 ===== */
.member-select-wrapper {
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.member-select-header {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-select-count {
    font-size: 12px;
    color: #999;
}

.member-select-count.max {
    color: #ff4444;
    font-weight: bold;
}

.member-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0;
}

.member-thumb-item {
    flex-shrink: 0;
    width: 60px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.member-thumb-item.selected {
    transform: scale(1.1);
}

.member-thumb-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.member-thumb-item.selected .member-thumb-img {
    border-color: #667eea;
}

.member-thumb-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #667eea;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.member-thumb-badge.female {
    background: #ff69b4;
}

.member-thumb-item.selected .member-thumb-badge {
    background: #ff4444;
}

.member-thumb-item.selected .member-thumb-badge.female {
    background: #ff1493;
}

/* ===== 채팅 입력 영역 ===== */
.chat-input-wrapper {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #667eea;
}

#sendButton {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

#sendButton:hover {
    background: #5568d3;
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== 로딩 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ===== 모바일 반응형 ===== */
@media (max-width: 768px) {
    html {
        height: 100%;
    }
    
    body {
        height: 100%;
        min-height: 100%;
    }
    
    .site-header {
        flex-shrink: 0;
    }
    
    .nasolo-chat-container {
        padding: 10px;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .nasolo-header {
        padding: 10px 15px;
        margin-bottom: 8px;
    }
    
    .nasolo-header h1 {
        font-size: 14px;
    }
    
    .header-right {
        font-size: 12px;
        gap: 8px;
    }
    
    .broadcast-status {
        font-size: 16px;
    }
    
    .chat-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .member-select-wrapper {
        padding: 8px 15px;
        flex-shrink: 0;
        max-height: 120px;
        overflow-x: auto;
    }
    
    .chat-input-wrapper {
        padding: 8px 15px;
        flex-shrink: 0;
        background: white;
    }
    
    #messageInput {
        font-size: 16px;
        padding: 10px 12px;
    }
    
#sendButton {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* ========================================
   공지 시스템 스타일
   ======================================== */

/* 공지 바 */
.chat-notice-bar {
    background: #fff9e6;
    color: #000;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-shrink: 0;
    animation: noticeSlide 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #ffe699;
}

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

.notice-icon {
    display: none;
}

@keyframes noticePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notice-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.notice-label {
    font-weight: bold;
    color: #ff6b00;
    flex-shrink: 0;
    font-size: 13px;
}

.notice-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.notice-list-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.3s;
    color: #666;
}

.notice-list-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

/* 공지 아이템 */
.notice-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.notice-item:hover {
    background: #f8f9fa;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-item-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.notice-item-content {
    color: #333;
    line-height: 1.6;
    word-break: break-word;
}

/* 모바일 반응형 - 공지 */
@media (max-width: 768px) {
    .chat-notice-bar {
        padding: 6px 12px;
        margin-bottom: 8px;
    }
    
    .notice-text {
        font-size: 13px;
    }
    
    .notice-list-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
.notice-item {
        padding: 12px;
    }
}

/* ========================================
   관리자 우클릭 메뉴 (툴팁 스타일)
   ======================================== */

.admin-context-menu {
    position: fixed;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 3px solid #667eea;
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(102, 126, 234, 0.1);
    z-index: 10000;
    min-width: 200px;
    padding: 8px;
    animation: menuSlideIn 0.2s ease;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-menu-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    font-weight: 600;
    background: white;
    margin-bottom: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-menu-item:last-child {
    margin-bottom: 0;
}

.admin-menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.admin-delete-btn {
    padding: 3px 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 5px;
    transition: all 0.2s;
}

.admin-delete-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* 블라인드 애니메이션 */
@keyframes blindAnimation {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.98);
        background: #ffebee;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.message.blinded {
    animation: blindAnimation 0.5s ease;
}

/* 관리자 클릭 가능한 이름 */
.message-author.admin-clickable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.message-author.admin-clickable:hover {
    background: rgba(102, 126, 234, 0.1);
}

.message-author.admin-clickable:active {
    background: rgba(102, 126, 234, 0.2);
}

/* ========================================
   공지 상세 모달 추가 스타일
   ======================================== */

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-footer .btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.modal-footer .btn:hover {
    background: #5568d3;
}

.modal-footer .btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.notice-detail-content {
    word-break: break-word;
}

.notice-detail-content a {
    color: #667eea;
    text-decoration: underline;
}

.notice-detail-content a:hover {
    color: #5568d3;
}

/* 더보기 버튼 */
.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* ========================================
   관리자 전용 - 강퇴/차단 배지
   ======================================== */

.ban-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
    animation: badgePulse 2s infinite;
}

.ban-status-badge.kicked {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    border: 1px solid #ff9800;
}

.ban-status-badge.banned {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: 1px solid #c82333;
}

@keyframes badgePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.ban-status-badge:hover {
    transform: scale(1.1);
    cursor: help;
}