:root {
  /* Brand Colors */
  --wf-primary: #0A1F44; /* Dark Navy */
  --wf-primary-light: #183366;
  --wf-accent: #3B82F6; /* Tech Blue */
  --wf-accent-hover: #2563EB;
  --wf-bg: #F8FAFC;
  --wf-card-bg: #FFFFFF;
  --wf-text-main: #1E293B;
  --wf-text-muted: #64748B;
  --wf-border: #E2E8F0;
  
  /* Spacing */
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 64px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px; /* Pill shapes */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: --wf-bg; /* Fallback */
  background-color: var(--wf-bg);
  color: var(--wf-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, p {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wf-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--wf-primary);
}

.nav-brand img {
  height: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--wf-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--wf-primary);
  background: #F1F5F9;
}

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

.avatar {
  width: 36px;
  height: 36px;
  background: var(--wf-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* Main Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
  flex: 1;
}

/* Hero / Chat Interface */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0 40px;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  color: var(--wf-primary);
  margin-bottom: 16px;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--wf-text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

.ai-input-wrapper {
  width: 100%;
  max-width: 700px;
  position: relative;
  margin-bottom: 32px;
}

.ai-input {
  width: 100%;
  padding: 24px;
  padding-right: 60px;
  border-radius: 20px;
  border: 1px solid var(--wf-border);
  background: white;
  box-shadow: 0 10px 40px -10px rgba(10, 31, 68, 0.1);
  font-size: 1.1rem;
  font-family: inherit;
  resize: none;
  min-height: 80px;
  outline: none;
  transition: all 0.2s ease;
}

.ai-input:focus {
  border-color: var(--wf-accent);
  box-shadow: 0 15px 50px -10px rgba(59, 130, 246, 0.2);
}

.ai-send-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: var(--wf-primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.ai-send-btn:hover {
  background: var(--wf-accent);
  transform: scale(1.05);
}

/* Suggestions / Chips */
.suggestion-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 48px;
}

.chip {
  background: white;
  border: 1px solid var(--wf-border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--wf-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--wf-accent);
  color: var(--wf-accent);
  background: #EFF6FF;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  margin-top: 24px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wf-primary);
}

.view-all {
  color: var(--wf-accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.tool-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--wf-border);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.08);
  border-color: var(--wf-accent);
}

.tool-icon {
  width: 48px;
  height: 48px;
  background: #EFF6FF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wf-accent);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.tool-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--wf-text-main);
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--wf-text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.category-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wf-text-muted);
  background: #F1F5F9;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.launch-btn {
  background: transparent;
  color: var(--wf-accent);
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.launch-btn:hover {
  text-decoration: underline;
}

/* Chat History / Results Page Specifics */
.chat-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
  width: 100%;
}

.message {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--wf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.message.ai .message-avatar {
  background: var(--wf-primary);
  color: white;
}

.message.user .message-avatar {
  background: #E2E8F0;
  color: var(--wf-text-main);
}

.message-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--wf-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  max-width: 80%;
}

.message.user .message-content {
  background: var(--wf-primary);
  color: white;
  border: none;
}

/* Recommended Tools within Chat */
.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.mini-tool-card {
  background: #F8FAFC;
  border: 1px solid var(--wf-border);
  padding: 16px;
  border-radius: 12px;
  transition: all 0.2s;
}

.mini-tool-card:hover {
  border-color: var(--wf-accent);
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Placeholder Icons */
.placeholder-icon {
  width: 24px;
  height: 24px;
  background-color: currentColor;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--wf-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--wf-primary-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--wf-border);
  color: var(--wf-text-main);
}

.btn-outline:hover {
  border-color: var(--wf-text-muted);
  background: white;
}

/* Sidebar Layout */
.page-layout {
  display: flex;
  gap: 40px;
  padding-top: 40px;
  align-items: flex-start;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
}

.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wf-text-muted);
  font-weight: 700;
  margin-bottom: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--wf-text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.sidebar-link:hover {
  background: white;
  color: var(--wf-accent);
}

.sidebar-link.active {
  background: white;
  color: var(--wf-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  font-weight: 600;
}

.directory-header {
  margin-bottom: 32px;
}

.search-bar-sm {
  width: 100%;
  padding: 12px 16px;
  padding-left: 44px;
  border-radius: 12px;
  border: 1px solid var(--wf-border);
  font-size: 0.95rem;
  background: white;
}

.search-wrapper-sm {
  position: relative;
  max-width: 400px;
}

.search-icon-sm {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wf-text-muted);
}

/* Utility */
.text-accent { color: var(--wf-accent); }

/* Authentication Pages */
.auth-body {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(10, 31, 68, 0.1);
  width: 100%;
  max-width: 440px;
  padding: 48px;
  border: 1px solid var(--wf-border);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--wf-primary);
}

.auth-brand img {
  height: 40px;
  object-fit: contain;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--wf-primary);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--wf-text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wf-primary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--wf-border);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
  background: #F8FAFC;
}

.form-input:focus {
  outline: none;
  border-color: var(--wf-accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-top: -8px;
}

.link {
  color: var(--wf-accent);
  font-weight: 500;
  cursor: pointer;
}

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

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  margin-top: 12px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--wf-text-muted);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--wf-border);
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  font-weight: 600;
  color: var(--wf-text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.social-btn:hover {
  background: #F8FAFC;
  border-color: var(--wf-text-muted);
}
