/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login Container */
.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 60px;
    height: 60px;
    background: #3b82f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.logo i {
    font-size: 24px;
    color: white;
}

.login-header h1 {
    color: #08444c;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

/* Form Styles */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.password-toggle:hover {
    color: #374151;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: #2563eb;
}

.login-btn:active {
    background: #1d4ed8;
}

/* Demo Hint */
.demo-hint {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Chat Page Styles */
.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    background: #08444c;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo i {
    font-size: 16px;
    color: white;
}

.header-info h1 {
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.header-info p {
    color: #6b7280;
    font-size: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: #374151;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f9fafb;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #08444c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar i {
    font-size: 14px;
    color: white;
}

.message-content {
    flex: 1;
}

.message-bubble {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.message-text {
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    color: #9ca3af;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-input {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 20px 24px;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-field {
    flex: 1;
    position: relative;
}

.input-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.input-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field textarea::placeholder {
    color: #9ca3af;
}

.send-btn {
    background: #08444c;
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #08444c;
}

.send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.suggestions {
    margin-top: 12px;
    color: #6b7280;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin: 10px;
        padding: 24px;
    }

    .chat-container {
        height: 100vh;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input {
        padding: 16px;
    }
}

/* Simple three-bouncing-dots animation */
  .loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
  }
  .loading-dots div {
    width: 8px;
    height: 8px;
    background-color: #08444c;
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
  }
  .loading-dots div:nth-child(2) {
    animation-delay: 0.2s;
  }
  .loading-dots div:nth-child(3) {
    animation-delay: 0.4s;
  }
  @keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
  }

/* TYTL chat welcome styles — additive, safe to paste */
:root {
  --tytl-bg: #f6f7f9;
  --tytl-ink: #0f172a;     /* deep slate */
  --tytl-muted: #475569;   /* mid slate */
  --tytl-accent: #0ea5e9;  /* calm blue accent */
  --tytl-bubble: #ffffff;  /* assistant bubble */
  --tytl-chip-bg: #eef2f7;
  --tytl-radius: 14px;
}

.chat-messages {
  background: var(--tytl-bg);
  padding: 16px;
}

/* message layout */
.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
}

.message-avatar {
  flex: 0 0 40px;
  height: 40px;
  width: 40px;
  border-radius: 10px;
  background: #08444c;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(14,165,233,.25);
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-bubble {
  background: var(--tytl-bubble);
  border-radius: var(--tytl-radius);
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.06);
  padding: 16px 18px;
  color: var(--tytl-ink);
  line-height: 1.5;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin: 0 0 6px 0;
  font-weight: 700;
  color: var(--tytl-ink);
}

.message-bubble h1 {
  font-size: 1.125rem; /* 18px */
  letter-spacing: -0.01em;
}
.message-bubble p.lead {
  margin: 0 0 10px 0;
  color: var(--tytl-muted);
}

/* list spacing */
.message-bubble ul {
  margin: 8px 0 0 1.25rem;
  padding: 0;
}
.message-bubble li {
  margin: 6px 0;
}

/* quick chips */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.quick-actions .chip {
  border: 1px solid #dbe2ea;
  background: var(--tytl-chip-bg);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: var(--tytl-ink);
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.quick-actions .chip:hover {
  transform: translateY(-1px);
  border-color: var(--tytl-accent);
}

/* time row */
.message-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tytl-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* small screens */
@media (max-width: 480px) {
  .message { gap: 10px; }
  .message-bubble { padding: 14px 16px; }
  .message-bubble h1 { font-size: 1rem; }
}

/* Replace all bullet points inside chat bubbles */
.message-bubble ul {
  list-style: none;            /* remove default bullets */
  margin: 8px 0 0 0;           /* reset default list margin */
  padding: 0;
}

.message-bubble li {
  position: relative;
  padding-left: 1.5rem;        /* space for custom bullet */
  margin: 8px 0;
}

.message-bubble li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0.4em;
  width: 10px;
  height: 10px;
  background-color: #08444c;
  border-radius: 3px; /* rounded square */
}

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  margin-bottom: 16px
}
.message-bubble th,
.message-bubble td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
}
.message-bubble th {
  text-align: left;
  font-weight: 700;
}
.message-bubble a { text-decoration: none; }
.message-bubble a:hover { text-decoration: underline; }


/* Admin link styles */
.admin-link {
    margin-top: 20px;
    text-align: center;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.admin-btn i {
    font-size: 16px;
}

/* Error message improvements */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.error-message i {
    font-size: 16px;
}

/* Demo hint improvements */
.demo-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e3f2fd;
    color: #1976d2;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
}

.demo-hint i {
    font-size: 16px;
}