:root {
    --primary-color: #8C9E7D; /* Sage green */
    --primary-dark: #6B7B5D;
    --bg-color: #F8F7F2; /* Cream/Warm beige */
    --chat-bg: #FFFFFF;
    --text-main: #333333;
    --text-muted: #7A7A7A;
    --bubble-bot: #F0F2ED;
    --bubble-user: #8C9E7D;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --widget-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Landing Page Styles */
.landing-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 50px;
    background: transparent;
    position: absolute;
    width: 100%;
    top: 0;
}

.landing-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    position: absolute;
    left: 50px;
}

.landing-header nav a {
    text-decoration: none;
    color: var(--text-main);
    margin: 0 20px;
    font-weight: 500;
    font-size: 1.15rem;
}

.hero-section {
    height: 80vh;
    background: linear-gradient(to right, rgba(248, 247, 242, 0.95) 0%, rgba(248, 247, 242, 0.85) 30%, rgba(248, 247, 242, 0.4) 60%, rgba(248, 247, 242, 0) 100%), url('assets/공슬기02.png') right 25% / cover no-repeat;
    display: flex;
    align-items: center;
    padding: 0 10%;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.3;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.shop-btn {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.shop-btn:hover {
    background: var(--primary-dark);
}

.about-section {
    padding: 100px 10%;
    text-align: center;
    background: white;
}

.about-section h2 {
    color: var(--primary-dark);
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.about-section p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Chat Widget Button */
.chat-widget-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 65px;
    height: 65px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: var(--widget-shadow);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Chat Container (Floating) */
.chat-container {
    position: fixed;
    bottom: 120px;
    right: 40px;
    width: 380px;
    height: 650px;
    max-height: calc(100vh - 160px);
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: var(--widget-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 1001;
    transform-origin: bottom right;
    animation: scaleIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.chat-header {
    background: var(--chat-bg);
    padding: 20px;
    border-bottom: 1px solid #EEEEEE;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.close-chat-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-chat-btn:hover {
    color: var(--text-main);
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-info .avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
}

.header-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
}

.header-text p {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #FAFAFA;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #DDDDDD;
    border-radius: 10px;
}

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

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

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

.bot-message .avatar {
    width: 35px;
    height: 35px;
    background: white;
    border: 1px solid #EEEEEE;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

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

.bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-break: keep-all;
}

.bot-message .bubble {
    background: var(--bubble-bot);
    color: var(--text-main);
    border-top-left-radius: 4px;
}

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

.chat-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #EEEEEE;
}

#chatForm {
    display: flex;
    gap: 10px;
    background: #F5F5F5;
    padding: 8px 12px;
    border-radius: 25px;
    align-items: center;
    transition: all 0.3s ease;
}

#chatForm:focus-within {
    box-shadow: 0 0 0 2px rgba(140, 158, 125, 0.2);
    background: white;
    border: 1px solid var(--primary-color);
}

#userInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-main);
}

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

#sendBtn:hover {
    background: var(--primary-dark);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 15px 18px;
    background: var(--bubble-bot);
    border-radius: 18px;
    border-top-left-radius: 4px;
    width: fit-content;
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    background: #AAAAAA;
    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); }
}

/* Music Widget Styles */
.music-widget {
    position: fixed;
    bottom: 40px;
    left: 40px;
    z-index: 999;
}

.music-toggle-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--primary-dark);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--widget-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: all 0.3s ease;
    animation: iconBlink 1.5s infinite ease-in-out;
}

.music-toggle-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
    animation: none;
}

.music-toggle-btn.playing {
    background: var(--primary-color);
    animation: pulseMusic 2s infinite;
}

@keyframes pulseMusic {
    0% { box-shadow: 0 0 0 0 rgba(140, 158, 125, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(140, 158, 125, 0); }
    100% { box-shadow: 0 0 0 0 rgba(140, 158, 125, 0); }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .landing-header {
        padding: 15px 20px;
        justify-content: center;
    }
    
    .landing-header .logo {
        position: static;
        font-size: 1.2rem;
    }
    
    .hero-section {
        background: linear-gradient(to bottom, rgba(248, 247, 242, 0.9) 0%, rgba(248, 247, 242, 0.6) 40%, rgba(248, 247, 242, 0.2) 100%), url('assets/공슬기02.png') center top / cover no-repeat;
        padding: 0 5%;
        height: 70vh;
        align-items: flex-start;
        padding-top: 15vh;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .about-section {
        padding: 60px 5%;
    }
    
    .about-section h2 {
        font-size: 1.8rem;
    }
    
    .about-section p {
        font-size: 1rem;
    }
    
    .chat-widget-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }
    
    .music-widget {
        bottom: 20px;
        left: 20px;
    }
    
    .music-toggle-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
    
    .chat-container {
        width: 90%;
        height: 70vh;
        right: 5%;
        bottom: 90px;
    }
}
