/* AIOS Hub Minimalist Dark Theme (Linear/Vercel Style) + Mobile Responsive */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #09090b;
  --bg-card: #111113;
  --bg-card-hover: #18181b;
  --border-card: #27272a;
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-violet: #8b5cf6;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "liga" 0;
}

/* Crisp Minimalist Cards (1px border, no neon glow) */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}

.kanban-col {
  min-height: 520px;
  background: #0c0c0e;
  border: 1px solid var(--border-card);
}

.project-card {
  transition: border-color 0.15s ease, background-color 0.15s ease;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}

.project-card:hover {
  border-color: #3f3f46;
  background: var(--bg-card-hover);
}

.badge-crit {
  transition: border-color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

/* Dropdowns and Options styling across all browsers */
select {
  background-color: #09090b !important;
  color: #fafafa !important;
  border: 1px solid #27272a !important;
}

select option {
  background-color: #09090b !important;
  color: #fafafa !important;
  padding: 8px 12px;
}

select option:checked {
  background-color: #18181b !important;
  color: #ffffff !important;
}

/* Inputs & Textareas */
input, textarea {
  background-color: #09090b !important;
  color: #fafafa !important;
  border: 1px solid #27272a !important;
}

input:focus, textarea:focus, select:focus {
  border-color: #52525b !important;
  outline: none !important;
  box-shadow: 0 0 0 1px #52525b !important;
}

input::placeholder, textarea::placeholder {
  color: #71717a !important;
}

/* Category Badges High Contrast */
.badge-cat-perso {
  background-color: #2e1065 !important;
  color: #e9d5ff !important;
  border: 1px solid #581c87 !important;
}

.badge-cat-pro {
  background-color: #082f49 !important;
  color: #bae6fd !important;
  border: 1px solid #075985 !important;
}

.badge-cat-aios {
  background-color: #022c22 !important;
  color: #a7f3d0 !important;
  border: 1px solid #065f46 !important;
}

.badge-cat-general {
  background-color: #18181b !important;
  color: #d4d4d8 !important;
  border: 1px solid #3f3f46 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Dual-Segment Left-Right Sliding Switch Button */
.service-sliding-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 84px;
  height: 30px;
  padding: 2px;
  border-radius: 9999px;
  background-color: #09090b;
  border: 1px solid #27272a;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease;
}

.service-sliding-switch:hover {
  border-color: #3f3f46;
}

.service-sliding-switch.is-on {
  border-color: rgba(16, 185, 129, 0.45);
}

.service-sliding-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 38px;
  height: 24px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.service-sliding-switch.is-on .service-sliding-thumb {
  transform: translateX(40px);
  background-color: #10b981;
  color: #09090b;
}

.service-sliding-switch.is-off .service-sliding-thumb {
  transform: translateX(0);
  background-color: #27272a;
  color: #e4e4e7;
}

.service-sliding-label {
  width: 38px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #71717a;
  z-index: 1;
}

/* Dual-Mode View Sliding Switch */
.view-sliding-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 68px;
  height: 30px;
  padding: 2px;
  border-radius: 9999px;
  background-color: #09090b;
  border: 1px solid #27272a;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease;
}

.view-sliding-switch:hover {
  border-color: #3f3f46;
}

.view-sliding-switch:focus-visible {
  outline: none;
  border-color: #fafafa;
}

.view-sliding-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 30px;
  height: 24px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  z-index: 2;
  background-color: #27272a;
  color: #fafafa;
}

.view-sliding-switch.is-compact .view-sliding-thumb,
.view-sliding-switch.is-list .view-sliding-thumb,
.view-sliding-switch.is-table .view-sliding-thumb {
  transform: translateX(0);
}

.view-sliding-switch.is-kanban .view-sliding-thumb,
.view-sliding-switch.is-grid .view-sliding-thumb {
  transform: translateX(32px);
}

.view-sliding-option {
  width: 32px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #71717a;
  z-index: 1;
}

/* ============================================================= */
/* TO-DO & TASK MANAGEMENT STYLES                                */
/* ============================================================= */
.task-row {
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.task-row:hover {
  border-color: #3f3f46;
}
.task-row.task-completed {
  opacity: 0.55;
}
.task-row.task-completed .task-title {
  text-decoration: line-through;
  color: #71717a;
}

.task-checkbox-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid #3f3f46;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
  background-color: #09090b;
}
.task-checkbox-btn:hover {
  border-color: #71717a;
}
.task-checkbox-btn.is-checked {
  background-color: #10b981;
  border-color: #10b981;
  color: #09090b;
}

.task-kanban-col {
  background: #0c0c0e;
  border: 1px solid #27272a;
  border-radius: 12px;
  min-height: 480px;
}
.task-kanban-card {
  cursor: grab;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.task-kanban-card:hover {
  border-color: #3f3f46;
}
.task-kanban-card:active {
  cursor: grabbing;
}

/* Studio Diarisation & Audio Karaoke Styles (Crisp, No Neon Glow) */
.turn-card {
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.turn-card.karaoke-active {
  background: #18181b !important;
  border-color: #06b6d4 !important;
  z-index: 10;
}

.turn-card.karaoke-active .turn-text {
  color: #fafafa !important;
  font-weight: 500;
}

.turn-card.karaoke-active .turn-play-btn {
  background-color: #06b6d4 !important;
  color: #09090b !important;
}

/* Shimmer on compute progress bar */
@keyframes shimmerAnim {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.progress-bar-shimmer {
  background-size: 200% 100%;
  animation: shimmerAnim 2.5s infinite linear;
}

/* Typing dots for Chat */
@keyframes chatDotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.chat-typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #a1a1aa;
  animation: chatDotPulse 1.2s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Mobile Bottom Bar & Safe Areas */
.mobile-bottom-nav {
  padding-bottom: var(--safe-bottom);
}

/* ============================================================= */
/* MOBILE RESPONSIVE OVERRIDES (< 768px)                         */
/* ============================================================= */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  header {
    padding-top: max(10px, var(--safe-top)) !important;
  }

  main#app-main {
    padding: 12px !important;
    padding-bottom: calc(82px + var(--safe-bottom)) !important;
  }

  /* Horizontal scroll-snap Kanban on mobile */
  .kanban-board-scroll {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
  }

  .kanban-board-scroll > .kanban-col,
  .kanban-board-scroll > .task-kanban-col {
    flex: 0 0 85vw !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    min-height: 340px !important;
    scroll-snap-align: center !important;
  }

  /* Touch-friendly controls */
  button, select, input[type="text"], input[type="date"], textarea {
    min-height: 40px;
  }

  /* Compact buttons inside cards stay nimble */
  .touch-compact {
    min-height: 32px !important;
  }

  /* Bottom-sheet / Full-screen Modals on mobile */
  .modal-sheet {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-sheet > div {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    padding-bottom: calc(16px + var(--safe-bottom)) !important;
  }

  /* Convert wide tables into stacked cards on mobile */
  .responsive-table thead {
    display: none;
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }
  .responsive-table tr {
    background: #111113;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
  }
  .responsive-table td {
    padding: 4px 0 !important;
    border: none !important;
  }
}
