:root {
    --white-chocolate: #EDE6D6;
    --silver-finish: #C8CAD0;
    --space-black: #0A0A0F;
    --navy-blue: #020530;
    --delicate-pine: #5C8A82;
    --shiny-bronze: #E8A33D;

    --font-primary: 'Lexend', 'Tajawal', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--white-chocolate);
    color: var(--space-black);
    height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
    border-radius: 24px;
    overflow: hidden;
}

.glassmorphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--silver-finish);
    z-index: 10;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.logo {
    height: 50px;
    margin-right: 15px;
    color: var(--navy-blue);
}

.header-title {
    font-weight: 600;
    color: var(--navy-blue);
    font-size: 1.1rem;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 100px 1.5rem 120px 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    max-width: 85%;
}

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

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

.avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--silver-finish);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.user-message .avatar {
    background: var(--delicate-pine);
    color: white;
    font-weight: 600;
}

.bubble {
    padding: 14px 20px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

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

.bot-message .bubble {
    background: var(--white-chocolate);
    color: var(--space-black);
    border-top-left-radius: 4px;
}

.input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--silver-finish);
    z-index: 10;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid var(--silver-finish);
    border-radius: 24px;
    padding: 8px 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--delicate-pine);
    box-shadow: 0 8px 25px rgba(92, 138, 130, 0.15);
}

textarea {
    flex: 1;
    border: none;
    resize: none;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    max-height: 150px;
    background: transparent;
    outline: none;
    color: var(--space-black);
    line-height: 1.5;
}

textarea::placeholder {
    color: #a0a0a0;
}

button {
    background: var(--shiny-bronze);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
    margin-left: 8px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

button:hover {
    background: #d69534;
    transform: scale(1.1);
}

button svg {
    width: 18px;
    height: 18px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-indicator {
    display: inline-flex;
    gap: 5px;
    padding: 4px 8px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--silver-finish);
    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); background: var(--delicate-pine); }
}
