/* --- Global Styles & Variables --- */
:root {
    --primary-color: #7c3aed; /* Vibrant Purple */
    --secondary-color: #a78bfa; /* Lighter Purple */
    --background-color: #121212; /* Dark Charcoal */
    --surface-color: #1e1e1e; /* Slightly Lighter Dark */
    --text-color: #e2e8f0; /* Soft White */
    --subtle-text-color: #94a3b8; /* Grayish White */
    --border-color: #334155;
    --font-family: 'Poppins', sans-serif;
    --border-radius: 12px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 500px;
    text-align: center;
}

/* --- Buttons --- */
.btn {
    text-decoration: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--background-color);
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
    font-size: 1rem;
}

/* --- Hero/Landing Page --- */
.hero-container {
    padding: 2rem;
}

.main-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.main-header p, .hero-main p {
    color: var(--subtle-text-color);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- Login/Signup Forms --- */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-box {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.form-box h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--subtle-text-color);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

.form-switch {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--subtle-text-color);
}
.form-switch a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}
.form-switch a:hover {
    text-decoration: underline;
}

/* --- Dashboard/Chat --- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 800px;
    background-color: var(--surface-color);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.dashboard-header h2 {
    color: var(--text-color);
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Custom scrollbar for chat window */
.chat-window::-webkit-scrollbar {
  width: 8px;
}
.chat-window::-webkit-scrollbar-track {
  background: var(--surface-color);
}
.chat-window::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 20px;
}

.chat-message {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

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

.chat-message.bot {
    background-color: #334155; /* Slate Gray */
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message.loading {
    align-self: flex-start;
    padding: 12px 18px;
}
.chat-message.loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--subtle-text-color);
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.chat-message.loading span:nth-child(1) { animation-delay: -0.32s; }
.chat-message.loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}


.chat-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

#chat-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#message-input {
    flex-grow: 1;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    color: var(--text-color);
    font-size: 1rem;
}

#message-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.btn-send:hover {
    background: var(--secondary-color);
}

.btn-send svg {
    color: white;
}


/* Topic text */
.chat-topic {
    margin: 8px 0 16px;
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

/* Counselor button - uses existing btn btn-secondary style */
.counselor-cta {
    text-align: center;
    margin-bottom: 12px;
}

.counselor-cta .btn-secondary {
    font-size: 0.95rem;
    padding: 8px 16px;
    display: inline-block;
}

/* Footer credit */
.app-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #777;
    font-family: 'Poppins', sans-serif;
}

.app-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}