/* === style.css === */
/* Base reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #202123;
    color: #ececec;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
}

.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    max-width: 720px;
    background: #343541;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.chat-header {
    background: #202123;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #4b4b4d;
}

.chat-header h1 {
    font-size: 1.25rem;
    color: #fff;
}

.chat-window:not(:empty) {
    padding: 1rem 1.5rem;
}
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: #343541;
    color: #ececec;
}

/* Message styles */
.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    line-height: 1.5;

    max-width: 80%;
}

/* User messages on right */
.message.user {
    background: #2e8bff;
    color: #fff;
    margin-left: auto;
    margin-right: 0;
}

/* Assistant messages on left */
.message.assistant {
    background: #4b4b4d;
    color: #ececec;
    margin-right: auto;
    margin-left: 0;
}

/* Markdown in assistant messages */
.message.assistant h1,
.message.assistant h2,
.message.assistant h3 {
    margin: 0.75rem 0;
    font-weight: 600;
}

.message.assistant p {
    margin: 0.5rem 0;
}

.message.assistant ul,
.message.assistant ol {
    margin: 0.5rem 0 0.5rem 1.25rem;
}

.message.assistant li {
    margin-bottom: 0.25rem;
}

.message.assistant pre {
    background: #202124;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    white-space: pre-wrap;
}

.message.assistant code {
    background: rgba(220, 220, 220, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

.message.assistant blockquote {
    border-left: 4px solid #5f6368;
    margin: 0.5rem 0;
    padding-left: 1rem;
    color: #b0b0b0;
}

.message.assistant a {
    color: #8ab4f8;
    text-decoration: underline;
}

.message.assistant img {
    max-width: 100%;
    border-radius: 4px;
    margin: 0.5rem 0;
}

/* Form */
.chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #202123;
    border-top: 1px solid #4b4b4d;
}

.chat-form input {
    flex: 1 1 auto;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: none;
    background: #3b3c42;
    color: #ececec;
}

.chat-form input:focus {
    outline: 2px solid #2e8bff;
}

.chat-form button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    background: #2e8bff;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    flex: 0;
}

.chat-form button:disabled {
    opacity: 0.5;
    cursor: default;
}

/* === styles.css === */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #333;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type='text'],
input[type='email'],
textarea,
button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

.contact-link {
    color: #fff;
    text-decoration: none;
    border: 1px solid #fff;
    padding: 10px 20px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 30px;
}

.contact-link:hover {
    background-color: #fff;
    color: #333;
}

/* Popup form styles */
.popup {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    overflow: auto;
    padding-top: 100px;
}

.popup-content {
    background-color: #333;
    margin: auto;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Spinner styles */
.spinner-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none; /* hide by default */
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
