:root {
    --primary-color: #FF6B6B;
    --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --bg-dark: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, #2D1B4E 0%, #0F172A 60%);
    z-index: -1;
}

.chat-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--glass-shadow);
}

@media (min-width: 768px) {
    .chat-container {
        height: 90vh;
        border-radius: 24px;
    }
}

.chat-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.logo svg {
    color: var(--primary-color);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

.message.system {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.message.user .avatar {
    background: #475569;
}

.bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.message.system .bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-top-left-radius: 4px;
}

.message.user .bubble {
    background: var(--primary-gradient);
    color: white;
    border-top-right-radius: 4px;
}

.hall-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
}

.hall-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.hall-card-content {
    cursor: pointer;
    margin-bottom: 10px;
}

.hall-reservation-button {
    width: auto;
    height: auto;
    padding: 8px 16px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    align-self: flex-end;
    margin-top: 8px;
}

.hall-reservation-button:hover {
    transform: translateY(-2px);
}

.hall-reservation-button:active {
    transform: translateY(0);
}

.hall-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #FF8E53;
}

.hall-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hall-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-input-area {
    padding: 20px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--glass-border);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    transition: border-color 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.progress-message {
    margin-top: 8px;
    font-size: 13px;
    color: #8b5cf6;
    text-align: left;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Image Slider */
.image-slider {
    position: relative;
    width: 100%;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

.image-container {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.image-container.loading::before {
    opacity: 1;
}

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

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.slider-image.active {
    opacity: 1;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%);
}

.slider-nav.prev {
    left: 10px;
}

.slider-nav.next {
    right: 10px;
}

/* Reservation Button */
.reservation-button-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    /* 스크롤바를 위한 여백 */
    white-space: nowrap;
}

.reservation-button {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    padding: 8px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

.reservation-button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.reservation-button:active {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(0);
}

/* Reservation Area */
.reservation-area {
    max-height: 200px;
    /* 여러 버튼을 표시하기에 충분한 높이 */
    overflow-y: auto;
    overflow-x: hidden;
    /* 세로 스크롤을 허용 */
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    opacity: 1;
    margin-bottom: 10px;
}

.reservation-area.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.reservation-area .reservation-button-container {
    margin-top: 0;
    padding: 10px 0;
    width: 100%;
    overflow-y: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    /* 가로 스크롤바 높이 */
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* More Link */
.more-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 12px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s;
}

.more-link:hover {
    opacity: 0.8;
}

/* Slot Buttons */
.slot-container {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 0;
    width: 0;
    min-width: 100%;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Firefox */
}

.slot-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: -4px;
    color: var(--text-secondary);
}

.slot-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.slot-button {
    flex: 0 0 auto;
    /* Don't shrink */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 4px 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    min-width: 50px;
}

.slot-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.slot-button:active {
    transform: translateY(0);
}

.slot-date {
    font-size: 0.7rem;
    margin-bottom: 0;
}

.slot-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.popup-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.popup-content {
    background: #1E293B;
    /* Dark card background */
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.popup-overlay.hidden .popup-content {
    transform: translateY(20px);
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

.popup-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.info-row .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-row .value {
    font-weight: 600;
    text-align: right;
}

.popup-caution {
    background: rgba(255, 107, 107, 0.1);
    /* Light red tint */
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.popup-caution p {
    font-weight: 600;
    color: #FF6B6B;
    margin-bottom: 8px;
}

.popup-caution ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

.popup-caution li {
    margin-bottom: 4px;
}

.popup-buttons {
    display: flex;
    gap: 12px;
}

.popup-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.popup-btn.primary {
    background: var(--primary-gradient);
    color: white;
}

.popup-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.popup-btn:hover {
    opacity: 0.9;
}

/* Venue Info Styles */
.venue-bubble {
    min-width: 280px;
}

.venue-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.venue-header .venue-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #FF8E53;
    margin: 0;
    flex: 1;
}

/* 펼치기/접기 토글 버튼 */
.venue-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.venue-toggle-btn:hover {
    color: var(--text-primary);
}

/* 접기/펼치기 컨텐츠 영역 */
.venue-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* 접힌 상태 */
.venue-bubble.collapsed .venue-content {
    display: none;
}

.venue-bubble.collapsed .venue-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.venue-info {
    margin-top: 12px;
}

.venue-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.meta-item {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    gap: 8px;
}

.meta-label {
    color: var(--text-secondary);
    min-width: 60px;
    flex-shrink: 0;
}

.halls-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hall-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
}

.hall-item .hall-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.hall-details {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hall-details li {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    gap: 8px;
}

.detail-label {
    color: var(--text-secondary);
    min-width: 70px;
    flex-shrink: 0;
}

.checklist {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.checklist-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.checklist-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checklist-items li {
    font-size: 0.85rem;
    color: var(--text-primary);
    padding-left: 16px;
    position: relative;
}

.checklist-items li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4ade80;
    font-size: 0.75rem;
}

.venue-detail-link {
    display: block;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.venue-detail-link:hover {
    opacity: 0.8;
}

/* WEDDING-TIME 예약 버튼 */
.wedding-time-booking-btn {
    display: block;
    margin-top: 12px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wedding-time-booking-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.wedding-time-booking-btn.realtime,
.wedding-time-booking-btn.consultation {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}