/* chat.css */

:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #ffffff;
    --system-color: #666666;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier Prime', 'Courier New', Courier, monospace;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #111 0%, #050505 100%);
    z-index: -1;
    opacity: 0.5;
}

#chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    margin: 20px;
    position: relative;
}

header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: bold;
    color: var(--accent-color);
}

.back-link {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

#chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--system-color) transparent;
}

#chat-log::-webkit-scrollbar {
    width: 6px;
}

#chat-log::-webkit-scrollbar-thumb {
    background-color: var(--system-color);
}

.message {
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: fadeIn 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
    color: var(--accent-color);
    text-align: right;
}

.message.ai {
    align-self: flex-start;
    color: var(--text-color);
    border-left: 2px solid var(--system-color);
    padding-left: 15px;
}

.message.system {
    align-self: center;
    font-size: 0.8rem;
    color: var(--system-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#user-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    min-height: 48px;
    max-height: 150px;
}

#user-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

#send-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    height: 48px;
    width: 48px;
}

#send-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

#send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#loading-indicator {
    height: 20px;
    display: flex;
    gap: 5px;
    align-items: center;
    padding-left: 5px;
}

.hidden {
    display: none !important;
}

.dot {
    width: 4px;
    height: 4px;
    background: var(--system-color);
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    from {
        opacity: 0.2;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    #chat-container {
        height: 100vh;
        margin: 0;
        border: none;
    }
}

.dev-banner {
    background: rgba(255, 68, 68, 0.15);
    border-bottom: 1px solid #ff4444;
    color: #ff4444;
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.1);
}

.dev-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    vertical-align: text-bottom;
}

.dev-icon svg {
    filter: drop-shadow(0 0 8px rgba(255, 68, 68, 0.6));
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { filter: drop-shadow(0 0 2px rgba(255, 68, 68, 0.4)); opacity: 0.8; }
    50% { filter: drop-shadow(0 0 10px rgba(255, 68, 68, 0.8)); opacity: 1; }
    100% { filter: drop-shadow(0 0 2px rgba(255, 68, 68, 0.4)); opacity: 0.8; }
}