* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 30px 20px 10px;
}

.auth-header h1 {
  color: #333;
  font-size: 26px;
}

.auth-header p {
  color: #888;
  font-size: 14px;
  margin-top: 5px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  margin-top: 20px;
}

.tab-btn {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: 0.2s;
}

.tab-btn.active {
  color: #6a11cb;
  border-bottom: 3px solid #6a11cb;
}

.tab-content {
  padding: 30px;
  display: none;
}

.tab-content.active {
  display: block;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #6a11cb;
  box-shadow: 0 0 0 3px rgba(106,17,203,0.1);
}

button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

button[type="submit"]:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Profile / dashboard card */
.profile-card {
  background: #fff;
  max-width: 380px;
  margin: 40px auto;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  overflow: hidden;
}

.profile-card-header {
  background: linear-gradient(135deg, #c8b6f7, #a8c5f7);
  padding: 40px 0 20px;
  text-align: center;
}

.profile-card-header img,
.profile-card-header .placeholder-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  background: #ddd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.profile-card-header h2 {
  margin-top: 14px;
  font-size: 19px;
  color: #222;
}

.profile-info {
  padding: 20px 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.info-row .label {
  color: #999;
}

.info-row .value {
  color: #333;
  font-weight: 500;
}

.menu-list {
  padding: 10px 24px 24px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

.menu-item:hover {
  color: #6a11cb;
}

.menu-item.logout {
  color: #e74c3c;
}

.upload-inline {
  margin-top: 10px;
}

.upload-inline input[type="file"] {
  font-size: 12px;
  margin-bottom: 8px;
}

.upload-inline button {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}
/* Tool hub grid */
.tool-hub {
  padding: 20px 24px 10px;
}

.tool-hub h3 {
  font-size: 15px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.tool-card {
  background: #f7f7fb;
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: 0.2s;
  border: 1px solid transparent;
}

.tool-card:hover {
  background: #fff;
  border-color: #6a11cb;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(106,17,203,0.12);
}

.tool-card .icon {
  font-size: 26px;
  display: block;
  margin-bottom: 8px;
}

.tool-card .name {
  font-size: 13px;
  font-weight: 600;
}

.tool-card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.tool-card.coming-soon:hover {
  background: #f7f7fb;
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

/* Back link used on every tool page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6a11cb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

.tool-page-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  padding: 40px 20px;
}

.tool-page-card {
  background: #fff;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  padding: 24px;
}

.tool-page-card h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 16px;
}
/* AI Chat tool styles */
.chat-window {
  background: #f7f7fb;
  border-radius: 14px;
  padding: 14px;
  height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-window::-webkit-scrollbar {
  width: 6px;
}
.chat-window::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: popIn 0.15s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.ai {
  align-self: flex-start;
  background: #fff;
  color: #333;
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
}

.msg.ai .label, .msg.user .label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 3px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-row input[type="text"] {
  flex: 1;
  margin-bottom: 0;
  border-radius: 20px;
  padding: 10px 16px;
}

.chat-input-row .file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f5;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-input-row .file-btn input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.chat-input-row .file-btn.has-file {
  background: #6a11cb;
  color: #fff;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.send-btn:hover {
  transform: scale(1.08);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-self: flex-start;
  background: #fff;
  border: 1px solid #eee;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #bbb;
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}
/* ===== Hub Page (full width, colorful gradient) ===== */

.hub-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #4b0fb3 0%, #7b2ff7 35%, #2575fc 100%);
  background-attachment: fixed;
  padding: 0;
  display: block;
}

.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.hub-topbar .brand {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-user img,
.hub-user .placeholder-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
}

.hub-user .username {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.hub-user .logout-pill {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  text-decoration: none;
  transition: 0.2s;
}

.hub-user .logout-pill:hover {
  background: rgba(255,255,255,0.28);
}

.hub-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px;
}

.hub-welcome {
  color: #fff;
  margin-bottom: 30px;
}

.hub-welcome h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.hub-welcome p {
  opacity: 0.85;
  font-size: 14px;
}

.hub-section-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
  margin-bottom: 16px;
  margin-top: 30px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.hub-card {
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: #222;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.2);
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.25);
}

.hub-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #7b2ff7, #2575fc);
}

.hub-card h3 {
  font-size: 15px;
  font-weight: 700;
}

.hub-card p {
  font-size: 12.5px;
  color: #777;
  line-height: 1.5;
  flex-grow: 1;
}

.hub-card .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-card .badge.ready {
  background: #e6f9ee;
  color: #1a9d5c;
}

.hub-card .badge.soon {
  background: #f0f0f5;
  color: #999;
}

.hub-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-card.disabled:hover {
  transform: none;
  box-shadow: none;
}

.hub-card .open-btn {
  margin-top: auto;
  background: linear-gradient(135deg, #7b2ff7, #2575fc);
  color: #fff;
  text-align: center;
  padding: 9px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
}

.hub-upload-row {
  margin-top: 34px;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.hub-upload-row span {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.hub-upload-row form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hub-upload-row input[type="file"] {
  margin-bottom: 0;
  background: rgba(255,255,255,0.9);
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.hub-upload-row button {
  width: auto;
  padding: 9px 16px;
  font-size: 12.5px;
  background: rgba(255,255,255,0.9);
  color: #4b0fb3;
  font-weight: 700;
}

@media (max-width: 640px) {
  .hub-topbar { padding: 14px 18px; }
  .hub-content { padding: 24px 18px; }
  .hub-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}