/*www/css/guest-chat.css */
/* 오버레이 - 초기 상태를 none으로 설정 */
.guest-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none; /* 기본적으로 숨김 */
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* active 클래스가 있을 때만 표시 */
.guest-chat-overlay.active {
    opacity: 1;
}

/* 모달 컨테이너 */
.guest-chat-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.guest-chat-overlay.active .guest-chat-modal {
    transform: translateY(0) scale(1);
}

/* 헤더 */
.guest-chat-header {
    background: linear-gradient(135deg, #3a96dd 0%, #2a7ab8 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.guest-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guest-chat-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
}

.guest-chat-title-wrap h3 {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 2px;
}

.guest-chat-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.guest-chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.guest-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 동의 화면 */
.guest-chat-agreement {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f5f5f7;
}

.agreement-content {
    text-align: center;
}

.agreement-icon {
    width: 72px;
    height: 72px;
    background: #e8f4fc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: #3a96dd;
}

.agreement-content h4 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
}

.agreement-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: left;
}

.agreement-section.warning {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
}

.agreement-section.warning .agreement-section-header i {
    color: #ff3b30;
}

.agreement-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.agreement-section-header i {
    font-size: 18px;
    color: #3a96dd;
}

.agreement-section-header span {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1e;
}

.agreement-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.agreement-section li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.agreement-section li:last-child {
    margin-bottom: 0;
}

.agreement-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    background: #c7c7cc;
    border-radius: 50%;
}

.agreement-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    cursor: pointer;
    justify-content: center;
}

.agreement-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #3a96dd;
    cursor: pointer;
}

.agreement-checkbox span {
    font-size: 14px;
    color: #1c1c1e;
}

.guest-chat-agree-btn {
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
}

.guest-chat-agree-btn:disabled {
    background: #e5e5ea !important;
    color: #c7c7cc !important;
    cursor: not-allowed;
}

/* 인증 화면 */
.guest-chat-verify {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    background: #f5f5f7;
}

.verify-content {
    text-align: center;
}

.verify-icon {
    width: 72px;
    height: 72px;
    background: #e8f4fc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: #3a96dd;
}

.verify-content h4 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.verify-content > p {
    font-size: 14px;
    color: #8e8e93;
    line-height: 1.5;
    margin: 0 0 32px;
}

.verify-input-group {
    margin-bottom: 16px;
}

.verify-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 0 16px;
    height: 52px;
    border: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.verify-input-wrap:focus-within {
    border-color: #3a96dd;
    box-shadow: 0 0 0 3px rgba(58, 150, 221, 0.12);
}

.verify-input-wrap i {
    color: #8e8e93;
    font-size: 20px;
    margin-right: 12px;
}

.verify-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
}

.verify-input-wrap input::placeholder {
    color: #c7c7cc;
    font-weight: 400;
}

.verify-countdown {
    color: #3a96dd;
    font-weight: 600;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.verify-input-group .btn {
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
}

.verify-code-group {
    margin-top: 16px;
}

.verify-btn-row {
    display: flex;
    gap: 10px;
}

.verify-btn-row .btn:first-child {
    flex: 0 0 100px;
}

.verify-btn-row .btn:last-child {
    flex: 1;
}

.verify-btn-row .btn {
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
}

.verify-login-link {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e5e5ea;
}

.verify-login-link span {
    font-size: 14px;
    color: #8e8e93;
}

.verify-login-link a {
    color: #3a96dd;
    font-weight: 600;
    margin-left: 8px;
    text-decoration: none;
}

.verify-login-link a:hover {
    text-decoration: underline;
}

/* 채팅 화면 */
.guest-chat-room {
    flex: 1;
    overflow-y: auto;
    background: #b2c7da;
    padding: 16px;
    position: relative;
}

.guest-chat-welcome {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin: 30px 0;
}

.guest-chat-welcome .welcome-icon {
    font-size: 48px;
    color: #3a96dd;
    margin-bottom: 12px;
}

.guest-chat-welcome h4 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #333;
}

.guest-chat-welcome p {
    font-size: 14px;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* 날짜 구분선 */
.guest-chat-date-divider {
    text-align: center;
    margin: 24px 0;
}

.guest-chat-date-divider span {
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 12px;
}

/* 메시지 행 */
.guest-chat-msg-row {
    display: flex;
    margin-bottom: 10px;
    width: 100%;
}

.guest-chat-msg-row.left {
    justify-content: flex-start;
}

.guest-chat-msg-row.right {
    justify-content: flex-end;
}

/* 프로필 영역 */
.guest-chat-profile {
    width: 38px;
    height: 38px;
    background: #3a96dd;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

.guest-chat-profile.hidden {
    visibility: hidden;
}

/* 메시지 콘텐츠 래퍼 */
.guest-chat-msg-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.guest-chat-msg-content.continuous {
    margin-top: -6px;
}

.guest-chat-sender-name {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    margin-left: 2px;
}

/* 버블 + 시간 컨테이너 */
.guest-chat-bubble-time {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.guest-chat-msg-row.left .guest-chat-bubble-time {
    flex-direction: row;
}

.guest-chat-msg-row.right .guest-chat-bubble-time {
    flex-direction: row-reverse;
}

/* 메시지 버블 */
.guest-chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.guest-chat-bubble.left {
    background: #fff;
    color: #333;
    border-top-left-radius: 2px;
}

.guest-chat-bubble.right {
    background: #fee500;
    color: #333;
    border-top-right-radius: 2px;
}

/* 이미지 버블 */
.guest-chat-bubble.image {
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    cursor: pointer;
}

.guest-chat-bubble.image img {
    display: block;
    max-width: 100%;
    min-width: 100px;
    max-height: 300px;
    border-radius: 14px;
    object-fit: cover;
}

/* 파일 버블 */
.guest-chat-bubble.file {
    padding: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    border: 1px solid #eee;
    cursor: pointer;
}

.guest-chat-bubble.file .file-icon-box {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #777;
}

.guest-chat-bubble.file .file-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.guest-chat-bubble.file .file-info .file-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-chat-bubble.file .file-info .file-size {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* 시간 표시 */
.guest-chat-time {
    font-size: 10px;
    color: #555;
    white-space: nowrap;
    margin-bottom: 2px;
}

/* 새 메시지 FAB */
.guest-chat-new-msg-fab {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
}

.new-msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* 입력 바 */
.guest-chat-input-bar {
    display: flex;
    align-items: flex-end;
    padding: 12px 8px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.guest-chat-attach-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.guest-chat-attach-btn.active {
    transform: rotate(45deg);
    color: #333;
}

.guest-chat-textarea-wrap {
    flex: 1;
    background: #f2f2f2;
    border-radius: 18px;
    padding: 8px 14px;
    margin: 0 6px;
    min-height: 36px;
    max-height: 120px;
    display: flex;
    align-items: center;
}

.guest-chat-textarea-wrap textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 20px;
    resize: none;
    outline: none;
    max-height: 104px;
    font-family: inherit;
}

.guest-chat-send-btn {
    width: 44px;
    height: 36px;
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #c7c7cc;
    transition: color 0.2s;
}

.guest-chat-send-btn:not(:disabled) {
    color: #3a96dd;
}

.guest-chat-send-btn:disabled {
    cursor: not-allowed;
}

/* 첨부 메뉴 */
.guest-chat-attach-menu {
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    flex-shrink: 0;
}

.guest-chat-attach-menu.open {
    max-height: 200px;
    border-top: 1px solid #f0f0f0;
}

.attach-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 4px;
}

.attach-menu-header span {
    font-size: 13px;
    font-weight: 500;
    color: #999;
}

.attach-menu-header button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-menu-grid {
    display: flex;
    padding: 12px 24px 24px;
    gap: 32px;
}

.attach-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.attach-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: opacity 0.15s ease;
}

.attach-icon.gallery {
    background: #34c759;
    color: #fff;
}

.attach-icon.file {
    background: #ff9500;
    color: #fff;
}

.attach-icon:active {
    opacity: 0.7;
}

.attach-menu-item span {
    font-size: 11px;
    color: #666;
}

/* 이미지 뷰어 */
.guest-chat-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.guest-chat-image-viewer.active {
    display: flex;
}

.guest-chat-image-viewer img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 로딩 스피너 */
.guest-chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
}

.guest-chat-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e5ea;
    border-top-color: #3a96dd;
    border-radius: 50%;
    animation: guest-chat-spin 0.8s linear infinite;
}

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

.guest-chat-loading span {
    font-size: 14px;
    color: #555;
}

/* 모바일 대응 */
@media (max-width: 480px) {
    .guest-chat-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .guest-chat-modal {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* 플로팅 버튼 chat 스타일 추가 */
.floating-btn.chat {
    background: linear-gradient(135deg, #3a96dd 0%, #2a7ab8 100%);
    color: #fff;
}

.floating-btn.chat:hover {
    transform: scale(1.05);
}

/* RTL 지원 (아랍어) */
/*
[data-lang="ar"] .guest-chat-modal {
    direction: rtl;
}

[data-lang="ar"] .guest-chat-profile {
    margin-right: 0;
    margin-left: 8px;
}

[data-lang="ar"] .guest-chat-msg-row.left .guest-chat-bubble-time {
    flex-direction: row-reverse;
}

[data-lang="ar"] .guest-chat-msg-row.right .guest-chat-bubble-time {
    flex-direction: row;
}

[data-lang="ar"] .verify-input-wrap i {
    margin-right: 0;
    margin-left: 12px;
}

[data-lang="ar"] .agreement-section li {
    padding-left: 0;
    padding-right: 14px;
}

[data-lang="ar"] .agreement-section li::before {
    left: auto;
    right: 0;
}*/