* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: #000000;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    position: relative;
}

/* 사이드바 */
.sidebar {
    width: 60px;
    background: rgba(20, 20, 20, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.sidebar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.2s;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #D4AF37;
}

.new-chat-btn {
    width: auto;
    padding: 8px 12px;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.new-chat-btn span {
    font-size: 10px;
    color: #ffffff;
}

/* 메인 컨테이너 */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
}

/* 헤더 */
.top-header {
    height: 60px;
    background-image: url('../../jangan.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: relative;
}

.top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 0;
}

.top-header > * {
    position: relative;
    z-index: 1;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #D4AF37;
}

/* 채팅 영역 */
.chat-area {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    position: relative;
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* 환영 화면 */
.welcome-screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    text-align: center;
}

.welcome-title {
    font-size: 36px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 60px;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.suggested-questions {
    text-align: left;
}

.suggested-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 24px;
}

.question-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.question-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.question-card:hover {
    border-color: #D4AF37;
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.question-dot {
    width: 8px;
    height: 8px;
    background: #D4AF37;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.question-content {
    flex: 1;
}

.question-category {
    display: inline-block;
    font-size: 12px;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 500;
}

.question-text {
    font-size: 15px;
    color: #ffffff;
    line-height: 1.5;
    margin: 0;
}

/* 채팅 메시지 */
.chat-messages {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 120px;
}

.message {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.user-message .message-content {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.bot-message .message-avatar {
    background: rgba(212, 175, 55, 0.2);
}

.user-message .message-avatar {
    background: rgba(255, 255, 255, 0.2);
}

.message-text {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 15px;
}

.bot-message .message-text {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.bot-message .message-text p {
    margin: 0 0 12px 0;
    line-height: 1.8;
}

.bot-message .message-text p:last-child {
    margin-bottom: 0;
}

.bot-message .message-text strong {
    color: #D4AF37;
    font-weight: 600;
}

.bot-message .message-text .message-list {
    margin: 12px 0;
    padding-left: 20px;
    list-style: none;
}

.bot-message .message-text .message-list li {
    margin: 8px 0;
    padding-left: 8px;
    position: relative;
    line-height: 1.7;
}

.bot-message .message-text .message-list li::before {
    content: '•';
    color: #D4AF37;
    position: absolute;
    left: -12px;
    font-weight: bold;
    font-size: 18px;
}

.bot-message .message-text .message-link {
    color: #D4AF37;
    text-decoration: underline;
    word-break: break-all;
}

.bot-message .message-text .message-link:hover {
    color: #E5C158;
}

/* 상담 섹션 */
.consultation-section {
    margin-top: 20px;
    padding-top: 20px;
}

.consultation-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.consultation-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.consultation-link {
    display: inline-block;
    color: #D4AF37;
    text-decoration: underline;
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 16px;
}

.consultation-link:hover {
    color: #E5C158;
}

.encouragement-text {
    margin-top: 20px;
    margin-bottom: 16px;
}

.encouragement-text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    margin: 0;
    font-style: italic;
}

.consultation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.consultation-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.phone-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.phone-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.phone-btn .btn-icon {
    width: 16px;
    height: 16px;
}

.kakao-btn {
    background: linear-gradient(135deg, #FEE500 0%, #FDD835 100%);
    color: #3C1E1E;
    border: none;
}

.kakao-btn:hover {
    background: linear-gradient(135deg, #FFEB3B 0%, #FEE500 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.online-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: #ffffff;
    border: none;
}

.online-btn:hover {
    background: linear-gradient(135deg, #FF8C5A 0%, #FF6B35 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* 면책 공고 박스 */
.disclaimer-box {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.disclaimer-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.disclaimer-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.user-message .message-text {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: #000000;
    font-weight: 500;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4AF37;
    animation: typing 1.4s infinite;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* 입력 영역 */
.input-area {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

#userInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#userInput:focus {
    outline: none;
    border-color: #D4AF37;
    background: rgba(255, 255, 255, 0.15);
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: #000000;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.send-button:hover {
    background: linear-gradient(135deg, #E5C158 0%, #D4AF37 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 푸터 */
.main-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #D4AF37;
}

.footer-divider {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 12px;
    font-size: 13px;
}

/* 팝업 모달 */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in;
}

.popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-modal {
    position: relative;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    transform: rotate(90deg);
}

.popup-content {
    padding: 40px;
    overflow-y: auto;
    color: #ffffff;
    line-height: 1.8;
    font-size: 14px;
}

.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.popup-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

.popup-content h1 {
    font-size: 24px;
    color: #D4AF37;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.popup-content h2 {
    font-size: 20px;
    color: #D4AF37;
    margin-top: 32px;
    margin-bottom: 16px;
}

.popup-content h3 {
    font-size: 18px;
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 12px;
}

.popup-content p {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.popup-content ul {
    margin: 16px 0;
    padding-left: 24px;
    list-style: none;
}

.popup-content ul li {
    margin: 8px 0;
    padding-left: 16px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
}

.popup-content ul li::before {
    content: '•';
    color: #D4AF37;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 18px;
}

.popup-content strong {
    color: #D4AF37;
    font-weight: 600;
}

.popup-content .section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 32px 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .question-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    @media (max-width: 480px) {
        .question-cards {
            grid-template-columns: 1fr;
        }
    }

    .message-text {
        max-width: 85%;
    }

    .input-area {
        padding: 16px;
    }
    
    .consultation-buttons {
        flex-direction: column;
    }
    
    .consultation-btn {
        width: 100%;
        justify-content: center;
    }

    .popup-modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .popup-content {
        padding: 24px;
        font-size: 13px;
    }

    .popup-content h1 {
        font-size: 20px;
    }

    .popup-content h2 {
        font-size: 18px;
    }

    .popup-content h3 {
        font-size: 16px;
    }
}
