/**
 * Seevee Recruiter Dashboard Styles
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 240px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}

.modal-close:hover {
  color: var(--text);
}

/* Auth Modal */
.auth-modal-content {
  width: 400px;
  padding: 40px;
}

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

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 24px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--primary);
  color: white;
}

.auth-form.hidden {
  display: none;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

.form-error.hidden {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: var(--bg);
  color: var(--text);
}

.btn:hover {
  background: var(--border);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-success:hover {
  background: var(--success-hover);
}

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

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* Main App Layout */
.app {
  display: flex;
  min-height: 100vh;
}

.app.hidden {
  display: none;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
  justify-content: flex-start;
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.sidebar-header .logo-text {
  font-size: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  background: var(--danger);
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-badge:empty {
  display: none;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.logout-btn {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

/* Views */
.view {
  display: none;
  flex: 1;
  padding: 24px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.view-header h2 {
  font-size: 24px;
}

.filter-select {
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

/* Chat View */
#chat-view {
  padding: 0;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 80%;
}

.message-assistant {
  align-self: flex-start;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-content {
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.5;
}

.message-assistant .message-content {
  background: var(--bg-secondary);
  border-bottom-left-radius: 4px;
}

.message-user .message-content {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-bottom-right-radius: 4px;
}

.system-message {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  text-align: center;
  max-width: 100%;
  align-self: center;
}

.message-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msg-btn {
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.msg-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
  padding: 16px 24px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-actions.hidden {
  display: none;
}

.action-btn {
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-container textarea {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.input-container textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.send-btn {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Jobs View */
.jobs-list {
  display: grid;
  gap: 16px;
}

.job-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.job-card-header h3 {
  font-size: 18px;
}

.job-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.job-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.job-status.paused {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.job-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.stat {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat strong {
  color: var(--text);
}

.stat.pending strong {
  color: var(--primary);
}

.job-actions {
  display: flex;
  gap: 8px;
}

/* Shortlist View */
.shortlist-list {
  display: grid;
  gap: 16px;
}

.candidate-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.candidate-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.candidate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.candidate-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.candidate-job {
  font-size: 13px;
  color: var(--text-secondary);
}

.match-score {
  font-size: 20px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.match-score.high {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.match-score.medium {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.match-score.low {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.candidate-summary {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.candidate-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.skill-tag {
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.candidate-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.pending_review {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.status-badge.approved {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-badge.rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.auto-badge {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Candidate Detail Modal */
.candidate-modal-content {
  width: 700px;
  padding: 32px;
}

.candidate-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.detail-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.candidate-meta {
  color: var(--text-secondary);
  font-size: 14px;
}

.match-score-large {
  font-size: 32px;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: var(--radius);
}

.warning-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.detail-section {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-label {
  width: 120px;
  font-size: 14px;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.score-fill.high { background: var(--success); }
.score-fill.medium { background: var(--warning); }
.score-fill.low { background: var(--danger); }

.score-value {
  width: 40px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
}

.must-ask-answers {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qa-item {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.qa-question {
  font-weight: 600;
  margin-bottom: 8px;
}

.qa-answer {
  color: var(--text-secondary);
  font-size: 14px;
}

.qa-notes {
  margin-top: 8px;
  font-size: 13px;
  color: var(--primary);
  font-style: italic;
}

.insight-item {
  margin-bottom: 16px;
}

.insight-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.insight-item p {
  font-size: 14px;
}

.insight-item.recommendation {
  background: rgba(99, 102, 241, 0.1);
  padding: 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.detail-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-header .logo-text,
  .nav-label,
  .user-info {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .main-content {
    margin-left: 60px;
  }

  .auth-modal-content {
    width: 100%;
    padding: 24px;
  }

  .candidate-modal-content {
    width: 100%;
    padding: 20px;
  }

  .detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .message {
    max-width: 90%;
  }
}
