/* ===== Global Styles ===== */
body {
    font-family: 'Fira Code', monospace;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #f9f9f9;
    box-sizing: border-box;
  }
  
  /* ===== Header ===== */
  header {
    background: #ffffff;
    color: #333;
    padding: 1rem;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  }

  .user-nav {
    display: flex;
    align-items: center;
  }
  
  .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
  }
  
  .welcome {
    font-size: 1rem;
  }
  
  .logout, .login-btn {
    background-color: #ff3860;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    text-decoration: none;
  }
  
  .logout:hover, .login-btn:hover {
    background-color: #e63253;
  }
  
  .new-convo {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
    background-color: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }
  
  .new-convo:hover {
    background-color: #ccc;
  }
  
  /* ===== Navigation Bar ===== */
  nav {
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
  }
  
  nav .icon {
    color: #555;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
  }
  
  nav .icon:hover {
    color: #000;
  }
  
  /* ===== Chat Area ===== */
  #chat {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
  }
  
  .user {
    align-self: flex-end;
    background-color: #d0ebff;
  }
  
  .ai {
    align-self: flex-start;
    background-color: #e2e2e2;
  }

  .references {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ddd;
    font-size: 0.85rem;
    color: #444;
  }
  
  .references-heading {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #222;
  }
  
  .references a {
    display: block;
    font-style: italic;
    color: #0a58ca;
    margin: 4px 0;
    padding-left: 1rem;
    position: relative;
    font-size: 0.82rem;
    text-decoration: none;
  }
  
  .references a::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #aaa;
    font-size: 0.75rem;
  }
  
  .references a:hover {
    text-decoration: underline;
    color: #063c91;
  }

  .reference-entry {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding-left: 1rem;
    font-size: 0.82rem;
    margin-bottom: 4px;
  }
  
  .reference-entry a {
    font-style: italic;
    color: #0a58ca;
    text-decoration: none;
    flex-shrink: 0;
  }
  
  .reference-entry a::before {
    content: "→";
    margin-right: 0.3rem;
    color: #aaa;
    font-size: 0.75rem;
  }
  
  .reference-entry a:hover {
    text-decoration: underline;
    color: #063c91;
  }
  
  .reference-entry .score {
    font-size: 0.75rem;
    color: #777;
  }
  
  
  /* ===== Input Area ===== */
  #input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
  }
  
  #input-area input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
  }
  
  #input-area button {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    cursor: pointer;
  }
  
  #input-area button:hover {
    background-color: #0056b3;
  }
  
  /* ===== Typing Indicator ===== */
  .typing::after {
    content: '|';
    animation: blink 1s step-start infinite;
  }
  
  @keyframes blink {
    0%, 50% {
      opacity: 1;
    }
    51%, 100% {
      opacity: 0;
    }
  }

  
  /* Login page styles */
.login-container {
    max-width: 500px;
    margin: auto;
    margin-top: 10vh;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: left;
  }
  
  .login-container h1 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: #333;
  }
  
  .login-container p {
    margin-bottom: 1.5rem;
    color: #666;
  }
  
  .login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
  }
  
  .login-form button {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    cursor: pointer;
  }
  
  .login-form button:hover {
    background-color: #0056b3;
  }
  
  /* OAuth button */
  .oauth-btn {
    display: inline-block;
    background-color: #db4437;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
  }
  
  .oauth-btn:hover {
    background-color: #c33d2e;
  }
  