* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    overflow: hidden;
    height: 100vh;
    margin: 0;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--tg-theme-button-color), #1a5fa0);
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
    opacity: 0.95;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--tg-theme-bg-color);
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--tg-theme-hint-color);
    border-radius: 10px;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--tg-theme-button-color);
}

.welcome-message h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--tg-theme-text-color);
    line-height: 1.4;
}

.welcome-message p {
    font-size: 15px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Messages */
.message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-bot {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px;
}

.message-user .message-content {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-bottom-right-radius: 4px;
}

.message-bot .message-content {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    border-bottom-left-radius: 4px;
}

/* Loading indicator */
.loading {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 18px;
    width: fit-content;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--tg-theme-hint-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Container */
.input-container {
    padding: 12px 16px 12px 16px;
    background: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 24px;
    padding: 8px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.attach-button,
.voice-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.attach-button:hover,
.voice-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--tg-theme-button-color);
}

.attach-button:active,
.voice-button:active {
    transform: scale(0.95);
}

.voice-button.recording {
    background: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--tg-theme-text-color);
    font-size: 16px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.5;
    padding: 8px;
}

#messageInput::placeholder {
    color: var(--tg-theme-hint-color);
}

.send-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.4);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-button svg,
.attach-button svg,
.voice-button svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    padding: 12px 20px;
    text-align: center;
    background: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 12px;
}

.author:hover {
    color: var(--tg-theme-link-color);
    background: rgba(0, 0, 0, 0.03);
}

.author svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.author span {
    font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .logo-text {
        font-size: 18px;
    }

    .chat-container {
        padding: 16px;
    }

    .welcome-message {
        padding: 30px 16px;
    }

    .welcome-icon {
        font-size: 48px;
    }

    .welcome-message h2 {
        font-size: 24px;
    }
}