:root {
    --primary: #ff9bb3;         /* Soft cherry blossom pink */
    --secondary: #6d4c41;       /* Warm brown for wood elements */
    --accent: #f8bbd0;         /* Light pink accent */
    --text: #2d3436;          /* Dark text */
    --background: #fff9f9;     /* Very soft pink background */
    --card-bg: #ffffff;       /* Pure white for cards */
    --error: #ff6b6b;         /* Soft red for errors */
    --success: #88c9a1;       /* Soft green for success */
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* Top Navigation */
.top-menu {
    background: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.site-logo {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.menu-items a {
    color: var(--secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.menu-items a:hover {
    background: var(--accent);
    color: var(--card-bg);
}

/* Cherry Blossom Animation */
.cherry-blossom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.cherry-blossom {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: fall linear forwards;
    transform: rotate(45deg);
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Chat Container */
.chat-container {
    max-width: 1000px;
    margin: 80px auto 20px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 30px var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(90vh - 100px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Chat Header */
.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    background: var(--card-bg);
    gap: 1rem;
}

.avatar-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.header-text {
    flex-grow: 1;
}

.header-text h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--secondary);
}

.tagline {
    margin: 0;
    color: var(--primary);
    font-style: italic;
}

/* Messages */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 155, 179, 0.1);
    border-radius: 15px;
    margin-bottom: 2rem;
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    animation: messageAppear 0.3s ease forwards;
}

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

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    margin: 0 10px;
}

.message-content {
    max-width: 70%;
    padding: 1rem;
    border-radius: 15px;
    background: var(--background);
    position: relative;
    box-shadow: 0 2px 5px var(--shadow);
}

.user-message .message-content {
    background: var(--primary);
    color: white;
}

.bot-message .message-content {
    background: var(--background);
}

.timestamp {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 0.5rem;
}

.user-message .timestamp {
    color: rgba(255, 255, 255, 0.8);
}

/* Input Area */
.chat-input {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
}

.chat-input input {
    flex-grow: 1;
    padding: 1rem;
    border: 2px solid var(--accent);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 155, 179, 0.2);
}

.chat-input button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.chat-input button:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.chat-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Counter Elements */
.counter-trigger {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
}

.counter-display {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 20px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 1000;
    font-size: 0.9em;
}

#resetConfirm {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 20px var(--shadow);
    z-index: 1001;
    text-align: center;
}

#resetConfirm button {
    margin: 0 5px;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#resetConfirm button:first-child {
    background: var(--error);
    color: white;
}

#resetConfirm button:last-child {
    background: var(--secondary);
    color: white;
}

/* Disclaimer */
.disclaimer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 90%);
    background: rgba(109, 76, 65, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 15px 15px 0 0;
    font-size: 0.9rem;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px var(--shadow);
    line-height: 1.4;
}

.disclaimer-content {
    max-width: 100%;
    margin: 0 auto;
}

/* Error Message */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
    padding: 1rem;
    margin: 1rem;
    border-radius: 10px;
    text-align: center;
    display: none;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--background);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.6;
}

.markdown-content p {
    margin: 0.5rem 0;
}

.markdown-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.markdown-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-container {
        margin: 60px 1rem 1rem;
        height: calc(100vh - 80px);
    }

    .message-content {
        max-width: 85%;
    }

    .disclaimer {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .menu-container {
        padding: 0 1rem;
    }

    .chat-input {
        padding: 1rem;
    }

    .chat-input input {
        padding: 0.8rem;
    }

    .chat-input button {
        padding: 0.8rem 1.5rem;
    }
}
