:root {
    --bg-color: #000000;
    --text-color: #D4AF37;
    /* Gold */
    --accent-color: #F8F8FF;
    /* Ghost White for slight contrast if needed, or lighter gold */
    --gold-dim: #AA8C2C;
    --gold-bright: #FFD700;
    --font-serif: 'Cormorant Garamond', serif;
    --font-jp: 'Noto Serif JP', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 1.5s ease-out;
}

.title {
    font-size: 2.5rem;
    /* Reduced further from 3rem */
    font-weight: 300;
    letter-spacing: 0.2rem;
    background: linear-gradient(45deg, var(--gold-dim), var(--gold-bright), var(--gold-dim));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: shine 5s linear infinite;
}

.subtitle {
    font-size: 1.5rem;
    /* Increased further from 1.3rem */
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--gold-dim);
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Chat Area */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dim) var(--bg-color);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Scrollbar styling */
#chat-container::-webkit-scrollbar {
    width: 6px;
}

#chat-container::-webkit-scrollbar-track {
    background: var(--bg-color);
}

#chat-container::-webkit-scrollbar-thumb {
    background-color: var(--gold-dim);
    border-radius: 3px;
}

/* Messages */
.message {
    display: flex;
    width: 100%;
    animation: fadeInUp 0.5s ease-out;
}

.message-content {
    max-width: 80%;
    padding: 1rem 1.5rem;
    line-height: 1.6;
    font-family: var(--font-jp);
    font-size: 1rem;
    border-radius: 4px;
    position: relative;
}

.ai-message {
    justify-content: flex-start;
}

.ai-message .message-content {
    border-left: 2px solid var(--gold-dim);
    background: rgba(212, 175, 55, 0.05);
    color: var(--text-color);
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    border-right: 2px solid var(--gold-dim);
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-bright);
    text-align: right;
}

/* Input Area */
.input-area {
    margin-bottom: 1rem;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--gold-dim);
    padding-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-bottom: 1px solid var(--gold-bright);
    box-shadow: 0 4px 6px -6px var(--gold-bright);
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-jp);
    font-size: 1.1rem;
    outline: none;
    padding: 0.5rem;
}

input[type="text"]::placeholder {
    color: var(--gold-dim);
    opacity: 0.5;
    font-style: italic;
    font-family: var(--font-serif);
}

button {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold-dim);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: var(--gold-dim);
    color: var(--bg-color);
    border-color: var(--gold-bright);
}

/* Footer */
footer {
    text-align: right;
    font-size: 1.1rem;
    /* Increased further from 1.0rem */
    color: var(--gold-dim);
    opacity: 0.6;
    margin-top: auto;
    font-family: var(--font-serif);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

@keyframes shine {
    to {
        background-position: 200% center;
    }
}