/* /httpdocs/style.css */
:root {
    --background-color: #1a1a1a;
    --surface-color: #242424;
    --primary-color: #0d6efd;
    --secondary-color: #6f42c1;
    --system-color: #ffc107;
    --text-color: #f0f0f0;
    --text-muted: #a0a0a0;
    --border-color: #333;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #1a0a24, #0d1a3a);
    animation: gradient-animation 20s ease infinite;
    background-size: 400% 400%;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    flex-direction: column; /* Added to stack content and footer vertically */
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header-logo {
    display: block;
    max-height: 45px; /* Controls the vertical size of the logo */
    margin: 0 auto 1.5rem; /* Centers the logo and adds space below it */
}

.container { 
    width: 100%; 
    height: 100%; 
    /* Add these lines to make the container a flex parent */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Allow container to take available space */
}

h1 { font-weight: 500; font-size: 1.75rem; letter-spacing: -0.5px; margin-bottom: 1.5rem; }

button {
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
button:hover { background: rgba(255, 255, 255, 0.2); }

/* View Styles */
.view { display: none; }
.view.active { display: block; }

/* Login View */
.login-view { max-width: 420px !important; margin: auto; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input { width: 100%; padding: 0.85rem 1rem; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: var(--text-color); font: inherit; font-size: 1rem; }
#login-error-message { color: #ff8a80; text-align: center; margin-top: 1rem; min-height: 1em; }

/* Hub View */
.hub-view { text-align: center; max-width: 500px; margin: auto; }
.hub-buttons { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.hub-buttons button { padding: 1.5rem; font-size: 1.2rem; }

/* Chat View (Shared) */
.chat-view { display: none; width: 100%; max-width: 800px; height: 90vh; margin: auto; flex-direction: column; }
.chat-view.active { display: flex; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.header button { max-width: 140px; font-size: 0.9rem; padding: 0.5rem 1rem; background-color: #6c757d; }
.chat-window { flex-grow: 1; overflow-y: auto; padding: 1rem; margin-bottom: 1rem; }
.chat-form { display: flex; gap: 1rem; }
.chat-form textarea { flex-grow: 1; resize: none; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: var(--text-color); font: inherit; padding: 0.85rem 1rem; }
.chat-form button { flex-shrink: 0; }

/* Message Bubble Styles */
.message { margin-bottom: 1.5rem; max-width: 85%; display: flex; flex-direction: column; }
.message .sender { font-size: 0.9rem; font-weight: bold; color: var(--text-muted); margin-bottom: 0.35rem; } /* UPDATED */
.message .text { padding: 0.85rem 1.25rem; border-radius: 18px; display: inline-block; white-space: pre-wrap; line-height: 1.6; text-align: left; border: 1px solid transparent; }

.user-message { align-items: flex-end; margin-left: auto; }
.user-message .sender { text-align: right; }
.user-message .text { background: linear-gradient(135deg, hsla(217, 100%, 50%, 0.4), hsla(217, 100%, 60%, 0.4)); border-color: hsla(217, 100%, 70%, 0.3); border-bottom-right-radius: 5px; color: white; }

.axis-message { align-items: flex-start; }
.axis-message .text { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); border-bottom-left-radius: 5px; }

.system-message { align-items: center; text-align: center; max-width: 100%; }
.system-message .text { background: transparent; font-size: 0.8rem; font-style: italic; color: var(--system-color); }

/* Footer Styles */
.footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem; /* Adjust as needed for spacing from content */
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle separator */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.75rem;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 850px) {
    .footer {
        margin-top: 1rem; /* Reduce margin on mobile */
        padding: 1rem 0.5rem; /* Adjust padding */
        background: rgba(255, 255, 255, 0.03); /* Slightly more visible background */
        position: relative; /* Keep it in the flow */
        z-index: 10; /* Ensure it's above other scrolling content if needed */
    }
    .footer a {
        display: block; /* Stack links vertically on mobile */
        margin: 0.5rem 0; /* Add vertical spacing */
    }
}