:root {
    /* New Palette */
    --color-green: #73b27d;
    --color-orange: #f1ad72;
    --color-red: #d31048;

    /* Derived Colors */
    --primary-gradient: linear-gradient(135deg, var(--color-red) 0%, var(--color-orange) 100%);
    --bg-gradient: linear-gradient(120deg, #ffffff 0%, #fcf5f1 100%);

    --glass-bg: rgba(255, 255, 255, 0.90);
    --glass-border: rgba(255, 255, 255, 0.8);

    --text-main: #2d3436;
    --text-muted: #636e72;

    --msg-bot-bg: #f8f9fa;
    --msg-user-bg: var(--color-red);
    --msg-user-text: #fff;

    --shadow-soft: 0 12px 40px 0 rgba(211, 16, 72, 0.15);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    min-height: 100vh;
    background: #fdfbf9;
    /* Soft background using the orange/red but very subtle */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(241, 173, 114, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(211, 16, 72, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(115, 178, 125, 0.1) 0%, transparent 60%);
    background-size: 100% 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow: hidden;
}

.app-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.glass-container {
    width: 100%;
    max-width: 500px;
    height: 85vh;
    max-height: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-image {
    width: 80px;
    height: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.chat-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: var(--color-red);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    background: rgba(255, 255, 255, 0.4);
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    animation: messageEntry 0.4s ease-out forwards;
}

@keyframes messageEntry {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.bot .avatar {
    background: #fff;
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

.message.user .avatar {
    background: var(--color-red);
    color: white;
}

.bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    word-wrap: break-word;
}

.message.bot .bubble {
    background: #ffffff;
    border-bottom-left-radius: 4px;
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user .bubble {
    background: var(--color-red);
    /* Using the strong red for user messages */
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(211, 16, 72, 0.3);
}

.chat-input-area {
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    background: #fff;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    /* default border */
}

.input-wrapper:focus-within {
    box-shadow: 0 8px 30px rgba(241, 173, 114, 0.2);
    /* Orange glow */
    border-color: var(--color-orange);
    transform: translateY(-2px);
}

input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 1.05rem;
    background: transparent;
    font-family: inherit;
    color: var(--text-main);
}

input::placeholder {
    color: #b2bec3;
}

button {
    width: 52px;
    height: 52px;
    border: none;
    background: var(--color-red);
    /* Red button */
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(211, 16, 72, 0.4);
}

button:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--color-orange);
    /* Orange on hover for interaction */
}

button:active {
    transform: scale(0.95);
}

.send-icon {
    margin-left: -2px;
    /* Visual centering */
    margin-top: 2px;
}

/* Result Box Style Update */
.result-box {
    background: rgba(115, 178, 125, 0.1);
    /* Green tint background */
    color: var(--color-green);
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(115, 178, 125, 0.3);
    margin-top: 8px;
    font-size: 1.1em;
}

/* Mates List Styles - New Feature */

.action-btn {
    width: 100%;
    height: auto;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    background: #fff;
    color: var(--color-red);
    border: 2px solid var(--color-red);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: none;
    transition: all 0.2s ease;
    text-align: center;
    display: block;
    /* ensure block layout inside bubble */
}

.action-btn:hover {
    background: var(--color-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 16, 72, 0.2);
}

.mates-list {
    margin-top: 10px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.mate-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.mate-item:last-child {
    border-bottom: none;
}

.mate-name {
    font-weight: 600;
    color: var(--text-main);
}

.mate-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f1f2f6;
    padding: 4px 8px;
    border-radius: 6px;
}



/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Responsive */
@media (max-width: 480px) {
    .glass-container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
        border: none;
    }

    .bubble {
        font-size: 0.95rem;
        padding: 14px 16px;
    }
}