/* ============================================================
   CANDIDIA — adaptive.css
   Device-adaptive layouts + Workflow steps + Module 1 UI
   style.css est INTACT — ce fichier étend uniquement
   ============================================================ */

/* === WORKFLOW STEPS ======================================== */
.workflow-step.hidden { display: none; }

@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.workflow-step.entering {
  animation: stepSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* === STEP NAV BAR ========================================== */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) 0 var(--s4);
  margin-bottom: var(--s1);
}

.step-nav.hidden { display: none; }

.step-back-btn {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--s2) var(--s3);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  min-height: 36px;
}

.step-back-btn:hover { background: var(--glass-bg-md); color: var(--text-1); }
.step-back-btn:active { transform: scale(0.96); }

.step-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-pill {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glass-border-strong);
  transition: all var(--t-base) var(--ease-spring);
}

.step-pill.active {
  width: 22px;
  border-radius: 3px;
  background: var(--blue);
}

.step-pill.done {
  background: var(--green);
}

.step-count {
  font-size: 0.80rem;
  color: var(--text-3);
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}

/* === TAG CHIPS ============================================= */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  min-height: 20px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--blue-dim);
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: var(--r-full);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 10px;
  animation: tagPop var(--t-fast) var(--ease-spring) both;
}

@keyframes tagPop {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}

.tag-chip.ats {
  background: var(--purple-dim);
  border-color: rgba(191, 90, 242, 0.2);
  color: var(--purple);
  font-size: 0.75rem;
}

.tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0 0 1px;
  opacity: 0.55;
  transition: opacity var(--t-fast) var(--ease);
  display: flex;
  align-items: center;
}

.tag-remove:hover { opacity: 1; }

.tag-add-input {
  margin-top: var(--s2) !important;
  font-size: 0.85rem !important;
  padding: var(--s2) var(--s3) !important;
}

/* === TWO-COL FORM ROW ====================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

/* === INLINE SPINNER ======================================== */
.spinner-inline {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === ERROR TOAST =========================================== */
.error-toast {
  display: none;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--red-dim);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: var(--r-lg);
  margin-top: var(--s2);
  font-size: 0.85rem;
  color: var(--red);
  line-height: 1.5;
}

.error-toast.visible { display: flex; }
.error-toast-icon { flex-shrink: 0; font-size: 1rem; }

/* === EXTRACTION SUMMARY (step-2 top) ====================== */
.extract-ok-banner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--green-dim);
  border: 1px solid rgba(48, 209, 88, 0.2);
  border-radius: var(--r-lg);
  margin-bottom: var(--s3);
}

.extract-ok-icon { font-size: 1.3rem; flex-shrink: 0; }

.extract-ok-text h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
}

.extract-ok-text p {
  font-size: 0.75rem;
  color: var(--green);
  margin-top: 1px;
}

.extract-source {
  margin-left: auto;
  font-size: 0.70rem;
  color: var(--text-3);
  flex-shrink: 0;
  text-align: right;
}

/* === SIDEBAR =============================================== */
.sidebar {
  display: none;
  flex-direction: column;
  width: 220px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  padding: calc(var(--sat) + var(--s5)) var(--s3) var(--s5);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 35%);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s6);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue) 0%, #5856D6 100%);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

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

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: none;
  background: transparent;
  border-radius: var(--r-lg);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.90rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-align: left;
  width: 100%;
  min-height: 44px;
}

.sidebar-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-btn:hover {
  background: var(--glass-bg-md);
  color: var(--text-1);
}

.sidebar-btn:hover svg { opacity: 1; }

.sidebar-btn.active {
  background: var(--blue-dim);
  color: var(--blue);
  font-weight: 600;
}

.sidebar-btn.active svg { opacity: 1; }

.sidebar-footer {
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--glass-border);
  margin-top: var(--s3);
}

.sidebar-version {
  font-size: 0.70rem;
  color: var(--text-4);
}

/* === VIEWS MAIN CONTAINER ================================== */
#views-main {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}

/* === TABLET — ≥ 640px ====================================== */
@media (min-width: 640px) {
  .two-col { gap: var(--s3); }
}

/* === DESKTOP — ≥ 1024px ==================================== */
@media (min-width: 1024px) {
  body { overflow: hidden; }

  .sidebar { display: flex; }

  .tab-bar { display: none !important; }

  #app {
    display: flex;
    height: 100dvh;
    max-width: none;
  }

  #views-main {
    flex: 1;
    margin-left: 220px;
  }

  .view {
    bottom: 0 !important; /* override tab-total */
    padding: var(--s8) var(--s8) var(--s6);
  }
}

@media (min-width: 1280px) {
  .view { padding: var(--s8) var(--s10) var(--s6); }
}

/* === LARGE DESKTOP — ≥ 1440px ============================== */
@media (min-width: 1440px) {
  .sidebar { width: 240px; }
  #views-main { margin-left: 240px; }
}
