/* SaaS Dashboard Global Styles */
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  margin: 0;
  padding: 0;
  display: flex;
  background-color: #f7f9fc;
  color: #1f2937;
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #272186 0%, #3e38c2 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  padding: 20px 15px;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 40px;
  padding-left: 10px;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  border-radius: 12px;
  color: #c7c6f0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-item i {
  font-size: 18px;
  width: 24px;
}

.upgrade-card {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
}

.upgrade-card h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.upgrade-card p {
  margin: 0 0 15px 0;
  font-size: 12px;
  color: #c7c6f0;
}

.upgrade-btn {
  background: white;
  color: #3e38c2;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

/* Main Content Area */
.content-area {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.ai-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-btn {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  cursor: pointer;
}

.avatar {
  background: #4f46e5;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.hero h1 {
  font-size: 42px;
  color: #111827;
  margin: 0 0 10px 0;
}

.hero h1 span {
  color: #4f46e5;
}

.hero p {
  color: #6b7280;
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
}

/* Toggle Switch */
.mode-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.toggle-pill {
  display: flex;
  background: white;
  padding: 5px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.toggle-pill button {
  padding: 10px 25px;
  border: none;
  background: transparent;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-pill button.active {
  background: #4f46e5;
  color: white;
}

/* Form Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  align-items: start;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.step-row {
  margin-bottom: 25px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  margin-right: 10px;
}

.step-label {
  font-weight: 600;
  color: #111827;
}

.form-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 14px;
  color: #374151;
  background: #f9fafb;
}

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  background: #f9fafb;
  margin-top: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #4f46e5;
  background: #eef2ff;
}

.drop-zone i {
  font-size: 30px;
  color: #4f46e5;
  margin-bottom: 10px;
}

.drop-zone-text {
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.file-input {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #3b82f6 100%);
  color: white;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

/* Features Sidebar */
.features-sidebar h3 {
  font-size: 16px;
  margin: 0 0 20px 0;
}

.feature-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.icon-purple { background: #f3e8ff; color: #9333ea; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.icon-blue { background: #e0f2fe; color: #0284c7; }

.feature-text h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
}
.feature-text p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.pro-tip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 15px;
  border-radius: 10px;
  margin-top: 30px;
}
.pro-tip h4 {
  color: #4f46e5;
  margin: 0 0 5px 0;
  font-size: 13px;
}
.pro-tip p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e5e7eb;
}

.badge {
  text-align: center;
  color: #6b7280;
}
.badge i {
  font-size: 20px;
  color: #4f46e5;
  margin-bottom: 10px;
}
.badge h5 {
  margin: 0 0 5px 0;
  font-size: 13px;
  color: #374151;
}
.badge p {
  margin: 0;
  font-size: 11px;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: absolute;
  top:0; left:0; right:0; bottom:0;
  background: rgba(255,255,255,0.9);
  border-radius: 20px;
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Fixes for history and other pages */
.history-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.history-heading { text-align: center; font-size: 28px; margin-bottom: 20px; color: #333; }
.history-list { display: flex; flex-direction: column; gap: 24px; }
.history-card { background: #ffffff; border: 1px solid #ddd; padding: 16px 20px; border-radius: 10px; }
.history-meta { display: flex; justify-content: space-between; font-size: 14px; color: #555; margin-bottom: 10px; }
.history-prompt { font-weight: bold; color: #4f46e5; }
.history-jobdesc pre { background: #f0f0f0; padding: 10px; border-radius: 6px; white-space: pre-wrap; font-size: 14px; }
.history-result { margin-top: 10px; font-size: 15px; }

/* Tips Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

.modal-close:hover {
  color: #111827;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.tips-list li {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tips-list li i {
  color: #4f46e5;
  margin-top: 3px;
}

/* Chat Widget Styles */
#chat-widget-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#chat-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-widget-button:hover {
  transform: scale(1.05);
}

#chat-window {
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom right;
}

.chat-widget-closed #chat-window {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

.chat-widget-open #chat-window {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.chat-header {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-info i {
  font-size: 24px;
}

.chat-header-info h4 {
  margin: 0;
  font-size: 15px;
}

.chat-header-info span {
  font-size: 11px;
  opacity: 0.8;
}

.close-chat {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
}

.close-chat:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #f9fafb;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}

.message p { margin: 0 0 8px 0; }
.message p:last-child { margin: 0; }

.ai-message {
  background: white;
  color: #374151;
  align-self: flex-start;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.user-message {
  background: #4f46e5;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 15px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
}

#chat-input:focus { border-color: #4f46e5; }

#send-chat-btn {
  background: #4f46e5;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#send-chat-btn:hover { background: #4338ca; }

.typing-dots {
  animation: blink 1.4s infinite both;
  font-size: 20px;
  color: #9ca3af;
}

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}