/* ===== Modern Glassmorphism Tech Theme ===== */

:root {
  --primary: #00ffe7;
  --accent: #00d0ff;
  --bg-dark: #0f1c2e;
  --bg-darker: #050c14;
  --glass: rgba(10, 30, 50, 0.55);
  --glass-blur: blur(18px);
  --border: rgba(0, 255, 255, 0.18);
  --shadow: 0 8px 32px 0 rgba(0,255,255,0.10);
  --radius: 18px;
  --transition: 0.25s cubic-bezier(.4,2,.6,1);
}

html, body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Share Tech Mono', monospace;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  color: var(--primary);
  letter-spacing: 0.01em;
  font-size: 18px;
  scroll-behavior: smooth;
}

/* ===== Navbar ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.7rem 0 0.7rem 0;
  margin-bottom: 2.5rem;
}
nav a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1.13rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
nav a:hover, nav a:focus {
  background: var(--accent);
  color: #101c2b;
  box-shadow: 0 2px 12px var(--accent);
}

/* ===== Logo ===== */
.logo {
  position: fixed;
  top: 1.2rem;
  left: 2.2rem;
  width: 60px;
  height: 60px;
  z-index: 200;
  border-radius: 50%;
  box-shadow: 0 0 32px 4px var(--accent), 0 0 0 4px var(--glass);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  animation: logoPulse 2.5s infinite alternate;
}
.logo:hover {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 48px 8px var(--primary), 0 0 0 6px var(--accent);
}
@keyframes logoPulse {
  0% { box-shadow: 0 0 32px 4px var(--accent), 0 0 0 4px var(--glass); }
  100% { box-shadow: 0 0 48px 8px var(--primary), 0 0 0 8px var(--accent); }
}

/* ===== Sections & Cards ===== */
.section {
  max-width: 900px;
  margin: 2.5rem auto;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  animation: fadeIn 1.2s cubic-bezier(.4,2,.6,1);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 24px 0 rgba(0,255,255,0.10);
  padding: 1.5rem 1.2rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeInUp 1.1s cubic-bezier(.4,2,.6,1);
}
.card:hover {
  transform: translateY(-8px) scale(1.04) rotate(-1deg);
  box-shadow: 0 8px 32px 0 var(--primary);
  border-color: var(--accent);
}

/* ===== Headings & Typography ===== */
h1, h2, h3 {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.7rem;
}
h1 {
  font-size: 2.7rem;
  margin-bottom: 1.2rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.3rem;
}
p, li, a {
  font-size: 1.08rem;
  line-height: 1.7;
}

/* ===== Loading Screen ===== */
.loading-bg {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-container {
  text-align: center;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 2.5rem;
  border: 1.5px solid var(--border);
  animation: fadeIn 1.2s cubic-bezier(.4,2,.6,1);
}
.loading-spinner {
  border: 8px solid #00d0ff33;
  border-top: 8px solid var(--primary);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: spin 1.2s linear infinite;
  margin: 0 auto 1.5rem auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Modal (Login) ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  padding: 2.2rem 2.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 320px;
  border: 1.5px solid var(--border);
}
.modal input[type="password"] {
  padding: 0.8rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-dark);
  color: var(--primary);
  font-size: 1.13rem;
  margin-bottom: 1.2rem;
  width: 80%;
}
.modal button {
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.7rem;
  font-size: 1.13rem;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition);
}
.modal button:hover {
  background: var(--primary);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  color: #008f9c;
  font-size: 1rem;
  margin: 3rem 0 1.5rem 0;
  opacity: 0.7;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: none; }
}

/* === AI Dashboard Layout === */
.ai-dashboard {
  display: flex;
  min-height: 80vh;
  max-width: 1400px;
  margin: 3rem auto 2rem auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
}
.sidebar {
  width: 290px;
  background: linear-gradient(135deg, #0f1c2e 80%, #00d0ff22 100%);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.2rem 1.2rem 1.2rem;
  gap: 2.2rem;
  min-height: 80vh;
}
.sidebar-header h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  letter-spacing: 0.04em;
}
.model-select {
  margin-bottom: 1.5rem;
}
.model-select label {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
  display: block;
}
#modelList {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-dark);
  color: var(--primary);
  font-size: 1.05rem;
  margin-top: 0.2rem;
}
.chat-history {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}
.chat-history h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
#historyList {
  list-style: none;
  padding: 0;
  margin: 0;
}
#historyList li {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.18s;
}
#historyList li.active, #historyList li:hover {
  background: var(--accent);
  color: #101c2b;
}
.logout-btn {
  background: var(--accent);
  color: #101c2b;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.2rem;
  transition: background 0.18s;
}
.logout-btn:hover {
  background: var(--primary);
}

/* === Chat Main === */
.chat-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #101c2b 80%, #00d0ff11 100%);
  min-height: 80vh;
  position: relative;
}
.chat-window {
  flex: 1 1 auto;
  padding: 2.2rem 2.5rem 1.2rem 2.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 400px;
  max-height: 65vh;
  scroll-behavior: smooth;
}

/* === Chat Bubbles === */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 1.1rem;
  animation: fadeInUp 0.7s cubic-bezier(.4,2,.6,1);
}
.message-row.user {
  flex-direction: row-reverse;
}
.message-bubble {
  max-width: 70%;
  padding: 1rem 1.3rem;
  border-radius: 18px 18px 6px 18px;
  background: var(--glass);
  color: var(--primary);
  font-size: 1.08rem;
  box-shadow: 0 2px 12px #00d0ff22;
  border: 1.5px solid var(--border);
  word-break: break-word;
  position: relative;
}
.message-row.user .message-bubble {
  background: var(--accent);
  color: #101c2b;
  border-radius: 18px 6px 18px 18px;
  border: 1.5px solid var(--accent);
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass);
  box-shadow: 0 0 8px var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  user-select: none;
}
.message-row.user .avatar {
  background: var(--accent);
  color: #101c2b;
}

/* === Chat Form === */
.chat-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2.5rem 1.2rem 2.5rem;
  background: var(--glass);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -2px 12px #00d0ff11;
}
#chatInput {
  flex: 1 1 auto;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-dark);
  color: var(--primary);
  font-size: 1.13rem;
  outline: none;
}
.chat-form button[type="submit"] {
  background: var(--accent);
  color: #101c2b;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.5rem;
  font-size: 1.13rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.chat-form button[type="submit"]:hover {
  background: var(--primary);
}
#clearChat {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--accent);
  cursor: pointer;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  transition: background 0.18s;
}
#clearChat:hover {
  background: var(--accent);
  color: #101c2b;
}

/* === Responsive === */
@media (max-width: 1000px) {
  .ai-dashboard {
    flex-direction: column;
    min-height: unset;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    min-height: unset;
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    padding: 1.2rem 0.7rem;
  }
  .chat-main {
    min-height: unset;
  }
  .chat-window {
    padding: 1.2rem 0.7rem 1.2rem 0.7rem;
    max-height: 50vh;
  }
  .chat-form {
    padding: 1.2rem 0.7rem 1.2rem 0.7rem;
  }
}
@media (max-width: 700px) {
  .ai-dashboard {
    margin: 1rem 0 1rem 0;
    border-radius: 0;
  }
  .sidebar {
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem 0.5rem;
  }
  .chat-window {
    padding: 0.7rem;
    max-height: 40vh;
  }
  .chat-form {
    padding: 0.7rem;
  }
} 