:root {
    --bg-dark: #1a1a1a;
    --fg-light: #e0e0e0;
    --chat-bubble-user: #4CAF50;
    --chat-bubble-ai: #333333;
    --text-color: #f0f0f0;
    --header-bg: #222222;
    --input-bg: #222222;
    --input-border: #444444;
    --send-button-bg: #4CAF50;
    --suggestion-bg: #444444;
    --suggestion-hover-bg: #555555;
    --date-color: #888888;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.registration-form {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 100;
}

.form-container {
    background-color: var(--chat-bubble-ai);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 80%;
    max-width: 350px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.form-header {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--fg-light);
    margin-bottom: 20px;
}

.registration-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #333;
    color: var(--fg-light);
    box-sizing: border-box;
}

.registration-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: var(--chat-bubble-user);
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.registration-form button:hover {
    background-color: #388e3c;
}

.chat-container {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 450px;
    height: 90vh;
    max-height: 800px;
    background-color: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.chat-container.active {
    display: flex;
}

.chat-container.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

.chat-header {
    background-color: var(--header-bg);
    color: var(--fg-light);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.chat-header .material-icons {
    font-size: 24px;
    cursor: pointer;
    color: var(--fg-light);
    margin: 0 5px;
}

.chat-header .header-title {
    flex-grow: 1;
    text-align: center;
}

.chat-area {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: #222;
    border-radius: 10px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.message {
    max-width: 75%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.95em;
    position: relative;
}

.message.user {
    background-color: var(--chat-bubble-user);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message.ai {
    background-color: var(--chat-bubble-ai);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message.error {
    background-color: #d32f2f;
    color: white;
}

.message.typing-indicator {
    background-color: var(--chat-bubble-ai);
    color: var(--text-color);
    font-style: italic;
    opacity: 0.8;
}

.message-date {
    font-size: 0.7em;
    color: var(--date-color);
    text-align: right;
    width: 100%;
    margin-top: -5px;
    margin-bottom: 10px;
}

.message.ai + .message-date {
    text-align: left;
}

.suggestion-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 15px;
    background-color: var(--input-bg);
    border-top: 1px solid var(--input-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.suggestion-container::-webkit-scrollbar {
    display: none;
}

.suggestion-button {
    background-color: var(--suggestion-bg);
    color: var(--text-color);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    max-width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.suggestion-button:hover {
    background-color: var(--suggestion-hover-bg);
    transform: translateY(-1px);
}

.suggestion-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.chat-input {
    display: flex;
    padding: 10px 15px;
    background-color: var(--input-bg);
    border-top: 1px solid var(--input-border);
    align-items: center;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 25px;
    background-color: #000;
    color: var(--fg-light);
    outline: none;
    font-size: 1em;
    margin-right: 10px;
}

.chat-input input::placeholder {
    color: #999;
}

.chat-input .send-button {
    background-color: var(--send-button-bg);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.chat-input .send-button:hover {
    background-color: #388e3c;
}

.chat-input .send-button .material-icons {
    color: white;
    font-size: 24px;
}

@media (max-width: 600px) {
    .chat-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .chat-header {
        padding: 12px 15px;
        font-size: 1.1em;
    }
    .chat-input {
        padding: 8px 10px;
    }
    .chat-input input {
        padding: 10px 12px;
        margin-right: 8px;
    }
    .chat-input .send-button {
        width: 40px;
        height: 40px;
    }
    .message {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    .suggestion-button {
        padding: 7px 12px;
        font-size: 0.8em;
    }
}