/* ==========================================
   BodaSafe / Teachable Agent Production CSS
   ================================---------- */

   :root {
    --bg-main: #090d16;
    --bg-card: #111827;
    --bg-input: #030712;
    --border-color: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-indigo: #4f46e5;
    --accent-indigo-hover: #4338ca;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Layout Utilities */
.flex-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .flex-container {
        flex-direction: row;
        overflow: hidden;
    }
}

/* Auth Cards */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.auth-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-indigo);
}

.form-error {
    font-size: 0.7rem;
    color: var(--accent-rose);
    font-weight: 600;
    margin-top: 0.25rem;
}

.btn-primary {
    width: 100%;
    background-color: var(--accent-indigo);
    color: white;
    font-weight: 700;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-indigo-hover);
}

.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: #818cf8;
    font-weight: 700;
    text-decoration: none;
}

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

/* Dashboard Layout */
.main-arena {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    height: 60vh;
}

@media (min-width: 1024px) {
    .main-arena {
        height: 100vh;
        padding: 2.5rem;
    }
}

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

.dashboard-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
}

.dashboard-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-listening {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    animation: pulse 2s infinite;
}

.badge-thinking {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
}

.badge-speaking {
    background-color: rgba(79, 70, 229, 0.2);
    color: #818cf8;
}

.badge-paused {
    background-color: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Feed */
.chat-box {
    flex: 1;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-msg-wrapper {
    display: flex;
}

.chat-msg-wrapper.user {
    justify-content: flex-end;
}

.chat-msg-wrapper.agent {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .chat-bubble {
        max-width: 500px;
        font-size: 0.9rem;
    }
}

.chat-bubble.user {
    background-color: var(--accent-indigo);
    color: white;
}

.chat-bubble.agent {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Bottom Control Bar */
.control-bar {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .control-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.live-interim {
    font-size: 0.75rem;
    color: #818cf8;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #1f2937;
}

/* Sidebar */
.sidebar {
    width: 100%;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 40vh;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 380px;
        border-top: none;
        border-left: 1px solid var(--border-color);
        height: 100vh;
    }
}

.sidebar-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #818cf8;
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* File Upload Button Styling */
.file-input {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Memory Cards */
.memory-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
}

.memory-card {
    background-color: rgba(3, 7, 18, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.75rem;
}

.memory-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    margin-bottom: 0.25rem;
}

.memory-text {
    color: #e5e7eb;
    line-height: 1.4;
}

.logout-btn {
    font-size: 0.75rem;
    background-color: var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #374151;
}

/* Password Guidelines Box */
.password-req-box {
    background-color: rgba(3, 7, 18, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.password-req-box ul {
    list-style: none;
    font-size: 0.75rem;
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-rose);
}

.req-item.valid {
    color: var(--accent-emerald);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.hidden {
    display: none !important;
}