/* styles.css — Custom styles for SafetyCulture AI Digital Twin */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.thinking-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #6559F5;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Pulse animation for in-progress items */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Slide in from bottom */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up {
  animation: slideUp 0.35s ease-out forwards;
}

/* Modal backdrop */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

/* Sidebar nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  text-decoration: none;
  user-select: none;
}
.nav-item:hover {
  background-color: #f3f4f6;
}
.nav-item.active {
  background-color: #eeecfe;
  color: #6559F5;
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #9ca3af;
}
.nav-item.active .nav-icon {
  color: #6559F5;
}

/* Sub-nav items */
.subnav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  user-select: none;
}
.subnav-link:hover {
  background-color: #f3f4f6;
  color: #374151;
}
.subnav-link.active {
  color: #374151;
  font-weight: 500;
}

/* Thread list item */
.thread-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
  user-select: none;
}
.thread-item:hover {
  background-color: #f3f4f6;
}
.thread-item.active {
  background-color: #f3f4f6;
}
.thread-item .thread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #d1d5db;
  flex-shrink: 0;
}
.thread-item.active .thread-dot {
  background-color: #6559F5;
}
.thread-item .thread-title {
  flex: 1;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-item .thread-time {
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Chat message bubbles */
.msg-user {
  max-width: 75%;
  margin-left: auto;
  background-color: #6559F5;
  color: white;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  line-height: 1.5;
}

.msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 12px;
  color: #374151;
  max-width: 220px;
}

.msg-assistant {
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
}

/* Thinking container */
.thinking-container {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  background: #fafafa;
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.thinking-header-chevron {
  color: #9ca3af;
  transition: transform 0.2s;
}
.thinking-container.collapsed .thinking-header-chevron {
  transform: rotate(-90deg);
}
.thinking-header-label {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}
.thinking-container.collapsed .thinking-steps {
  display: none;
}

/* Thinking steps */
.thinking-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: #6b7280;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}
.thinking-step .step-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thinking-step.complete .step-icon {
  color: #22c55e;
}
.thinking-step.pending {
  color: #d1d5db;
}

/* Agent work expandable */
.agent-work-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
  transition: color 0.15s;
}
.agent-work-toggle:hover {
  color: #6b7280;
}

/* Chat input area */
.chat-input-wrapper {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input-wrapper:focus-within {
  border-color: #6559F5;
  box-shadow: 0 0 0 3px rgba(101, 89, 245, 0.1);
}
.chat-textarea {
  resize: none;
  border: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  line-height: 1.5;
  background: transparent;
  min-height: 24px;
  max-height: 120px;
}
.chat-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Template cards */
.template-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: white;
}
.template-card:hover {
  border-color: #c7c3fc;
  box-shadow: 0 2px 8px rgba(101, 89, 245, 0.08);
  transform: translateY(-1px);
}

/* Automation status indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.status-badge.in-progress {
  background-color: #fef3c7;
  color: #92400e;
}
.status-badge.completed {
  background-color: #dcfce7;
  color: #166534;
}

/* Modal styles */
.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Day of week selector */
.day-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  border: 1.5px solid #e5e7eb;
  color: #6b7280;
  background: white;
  user-select: none;
}
.day-toggle.active {
  background-color: #1f2937;
  color: white;
  border-color: #1f2937;
}

/* Skill card */
.skill-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  background: white;
}

/* Sidebar collapse transition */
#app-sidebar {
  transition: width 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}
#app-sidebar.collapsed {
  width: 0 !important;
  opacity: 0;
  padding: 0;
  border: none;
}

/* Placeholder page */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
}

/* Compose model picker */
.compose-model-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 7px;
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.compose-model-toggle:hover {
  background: #f9fafb;
  color: #6b7280;
  border-color: #d1d5db;
}
.compose-model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 140px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 4px;
  z-index: 20;
}
.compose-model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: #374151;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.1s;
}
.compose-model-option:hover {
  background: #f3f4f6;
}
.compose-model-option.selected {
  font-weight: 500;
}
.compose-opus-hint {
  font-size: 11px;
  color: #b0b0b0;
  white-space: nowrap;
}
.compose-upgrade-link {
  color: #6559f5;
  font-weight: 600;
  text-decoration: none;
}
.compose-upgrade-link:hover {
  text-decoration: underline;
}

/* Upgrade splash */
.upgrade-splash-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  width: min(560px, calc(100vw - 32px));
}
.upgrade-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.upgrade-plan-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f9fafb;
}
.upgrade-plan-card-pro {
  border-color: #c7c3fc;
  background: #eeecfe;
}
.upgrade-plan-name {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.upgrade-plan-price {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.upgrade-plan-limit {
  font-size: 12px;
  color: #6b7280;
}
