/* css/components/tips-page.css */

.tips-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-family: 'Nunito', sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────── */

.tips-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.tips-back-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #eef2ff;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.tips-back-btn:hover {
  background: #dbeafe;
  color: #1e293b;
}

.tips-page-header-text {
  flex: 1;
}

.tips-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px;
  line-height: 1.2;
}

.tips-page-subtitle {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
}

/* ── Level tabs (home) ───────────────────────────────────────────── */

.tips-level-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tips-level-tab {
  padding: 8px 20px;
  border-radius: 20px;
  border: 2px solid var(--tips-level-color, #1e9d8e);
  background: #fff;
  color: var(--tips-level-color, #1e9d8e);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.tips-level-tab:hover,
.tips-level-tab.active {
  background: var(--tips-level-color, #1e9d8e);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--tips-level-color, #1e9d8e) 30%, transparent);
}

/* ── Skills grid (home) ──────────────────────────────────────────── */

.tips-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tips-skill-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}

.tips-skill-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tips-skill-color, #1e9d8e);
  border-radius: 4px 0 0 4px;
}

.tips-skill-card:hover {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  border-color: var(--tips-skill-color, #1e9d8e);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.tips-skill-card:focus {
  outline: 2px solid var(--tips-skill-color, #1e9d8e);
  outline-offset: 2px;
}

.tips-skill-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--tips-skill-color, #1e9d8e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tips-skill-card-body {
  flex: 1;
  min-width: 0;
}

.tips-skill-card-level {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.tips-skill-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  margin: 2px 0 4px;
}

.tips-skill-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tips-skill-card-arrow {
  color: #cbd5e1;
  font-size: 13px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.tips-skill-card:hover .tips-skill-card-arrow {
  color: var(--tips-skill-color, #1e9d8e);
}

/* ── Skill badge (detail page header) ───────────────────────────── */

.tips-skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--tips-skill-color, #1e9d8e);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* ── Level pills (detail page) ───────────────────────────────────── */

.tips-level-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tips-level-pill {
  padding: 6px 16px;
  border-radius: 16px;
  border: 2px solid var(--tips-level-color, #1e9d8e);
  background: #fff;
  color: var(--tips-level-color, #1e9d8e);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.tips-level-pill:hover,
.tips-level-pill.active {
  background: var(--tips-level-color, #1e9d8e);
  color: #fff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--tips-level-color, #1e9d8e) 28%, transparent);
}

/* ── Detail layout ──────────────────────────────────────────────── */

.tips-detail-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* ── Parts navigation sidebar ───────────────────────────────────── */

.tips-parts-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 90px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.tips-part-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  font-family: inherit;
}

.tips-part-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateX(2px);
}

.tips-part-btn.active {
  background: var(--primary, #2D2E5F);
  color: #fff;
  border-color: var(--primary, #2D2E5F);
}

.tips-parts-content {
  min-width: 0;
}

/* ── Part section ────────────────────────────────────────────────── */

.tips-part-section,
.tips-simple-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.tips-part-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.3;
}

/* ── Tips list ───────────────────────────────────────────────────── */

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tips-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.tips-list-icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}

/* ── Loading / error states ──────────────────────────────────────── */

.tips-loading {
  text-align: center;
  color: #64748b;
  padding: 60px 20px;
  font-size: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.tips-error {
  text-align: center;
  color: #ef4444;
  padding: 40px 20px;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 14px;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .tips-page-title {
    font-size: 1.3rem;
  }

  .tips-skills-grid {
    grid-template-columns: 1fr;
  }

  .tips-page-header {
    padding: 12px;
    margin-bottom: 18px;
  }

  .tips-detail-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tips-parts-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }

  .tips-part-btn {
    font-size: 0.78rem;
    padding: 6px 11px;
    width: auto;
    text-align: center;
  }

  .tips-part-section,
  .tips-simple-section {
    padding: 16px;
  }
}
