/* ============================================================
   YouAİBOOKS — Top Bar, Stats Strip, Legend
   React'e geçişte: <TopBar>, <StatsStrip>
============================================================ */

/* ----------------------------------------------------------
   Top Bar
---------------------------------------------------------- */
.top-bar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

/* ----------------------------------------------------------
   Hamburger Sidebar Toggle
---------------------------------------------------------- */
.sidebar-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-3);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background: var(--color-surface-4);
  border-color: var(--border-active);
}

.sidebar-toggle-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  stroke: currentColor;
}

/* ----------------------------------------------------------
   Top Bar Sections
---------------------------------------------------------- */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-bar-center {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Date Navigation
---------------------------------------------------------- */
.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-3);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.arrow-btn:hover {
  background: var(--color-surface-4);
  color: var(--text-primary);
}

.arrow-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.current-date-display {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  min-width: 190px;
  text-align: center;
  user-select: none;
}

.today-pill {
  padding: 5px 13px;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--accent-primary-lt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: background var(--transition-fast);
}

.today-pill:hover {
  background: rgba(124, 58, 237, 0.22);
}

/* ----------------------------------------------------------
   View Switcher
---------------------------------------------------------- */
.view-switcher {
  display: flex;
  background: var(--color-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 5px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  transition: background var(--transition-fast), color var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
}

.view-btn.active {
  background: var(--color-surface-3);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--border-default);
}

.view-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* ----------------------------------------------------------
   Search
---------------------------------------------------------- */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  stroke: currentColor;
  fill: none;
}

.search-input {
  background: var(--color-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 32px;
  color: var(--text-primary);
  font-size: 12.5px;
  width: 190px;
  transition: border-color var(--transition-fast), width var(--transition-slow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--border-active);
  width: 220px;
  background: var(--color-surface-3);
}

/* ----------------------------------------------------------
   New Appointment CTA Button
---------------------------------------------------------- */
.btn-new {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-2));
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  box-shadow: 0 4px 18px var(--accent-primary-glow),
              0 0 0 1px rgba(124, 58, 237, 0.3);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-new:hover {
  box-shadow: 0 6px 24px var(--accent-primary-glow),
              0 0 0 1px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.btn-new:active {
  transform: translateY(0);
}

.btn-new svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

/* ----------------------------------------------------------
   User Profile
---------------------------------------------------------- */
.user-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.user-avatar-ring {
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
  box-shadow: 0 0 14px var(--accent-primary-glow);
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-logout {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--color-surface-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.btn-logout:hover {
  color: var(--text-primary);
  background: var(--color-surface-4);
}

/* ----------------------------------------------------------
   Stats Strip
---------------------------------------------------------- */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: var(--stats-height);
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
}

.stats-strip::-webkit-scrollbar { height: 0; }

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Color variants */
.stat-chip.gold   .stat-value { color: var(--accent-gold-lt); }
.stat-chip.gold   .stat-dot   { background: var(--accent-gold); box-shadow: 0 0 6px var(--accent-gold-glow); }
.stat-chip.violet .stat-dot   { background: var(--accent-primary); box-shadow: 0 0 6px var(--accent-primary-glow); }
.stat-chip.teal   .stat-dot   { background: var(--cat-cut); }
.stat-chip.pink   .stat-dot   { background: var(--cat-nail); }

.stats-sep {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Categories box — takvimin hemen üstünde, mini takvim stili
---------------------------------------------------------- */
.categories-box {
  margin: 0 20px 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.legend-group.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Kategoriler: sayfanın en altı, tek sıra (punto/yazı boyutu aynı)
---------------------------------------------------------- */
.categories-strip-bottom {
  flex-shrink: 0;
  padding: 12px 20px;
  background: var(--color-surface-1);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.categories-strip-bottom::-webkit-scrollbar { height: 4px; }

.legend-group.legend-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  min-width: max-content;
}
