/* ===========================================================
   Булка — базовые стили (Apple-inspired design system)
   =========================================================== */

:root {
  /* Палитра — светлые тона в стиле Apple */
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-strong: rgba(255, 255, 255, 0.85);
  --bg-soft: #fafafc;

  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #a1a1a6;

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  /* Акцент — фирменный градиент "Булки" (тёплый, хлебный) */
  --accent: #ff6b35;
  --accent-2: #ff9558;
  --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #ffa369 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 163, 105, 0.12));

  --blue: #007aff;
  --blue-gradient: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);

  --error: #ff3b30;
  --success: #34c759;

  /* Тени — мягкие, многослойные (как в iOS) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08), 0 24px 80px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 10px 40px rgba(255, 107, 53, 0.25);

  /* Радиусы */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Переходы */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.18s;
  --t-med: 0.3s;
  --t-slow: 0.5s;

  /* Типографика */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Сброс ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  overflow: hidden;
  position: relative;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

input::placeholder {
  color: var(--text-tertiary);
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
}

/* ---------- Декоративные цветные пятна ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: float 18s ease-in-out infinite;
}

.blob--1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, #ffb088 0%, transparent 70%);
}

.blob--2 {
  width: 600px; height: 600px;
  bottom: -200px; right: -140px;
  background: radial-gradient(circle, #8cbfff 0%, transparent 70%);
  animation-delay: -6s;
}

.blob--3 {
  width: 420px; height: 420px;
  top: 40%; left: 40%;
  background: radial-gradient(circle, #ffd0a3 0%, transparent 70%);
  animation-delay: -12s;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              opacity var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn svg {
  width: 18px; height: 18px;
  transition: transform var(--t-med) var(--ease);
}

.btn--primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
  width: 100%;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 50px rgba(255, 107, 53, 0.35);
}

.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Иконочные кнопки ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}

.icon-btn svg { width: 18px; height: 18px; }

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.icon-btn:active { transform: scale(0.92); }

/* ---------- Аватар ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.avatar--sm { width: 36px; height: 36px; border-radius: 50%; font-size: 13px; }
.avatar--md { width: 44px; height: 44px; border-radius: 50%; font-size: 15px; }
.avatar--lg { width: 48px; height: 48px; border-radius: 50%; font-size: 17px; }

/* Разноцветные аватары через :nth-child для разнообразия */
.avatar[data-hue="1"] { background: linear-gradient(135deg, #ff6b35, #ffa369); }
.avatar[data-hue="2"] { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.avatar[data-hue="3"] { background: linear-gradient(135deg, #af52de, #ff6482); }
.avatar[data-hue="4"] { background: linear-gradient(135deg, #34c759, #30d158); }
.avatar[data-hue="5"] { background: linear-gradient(135deg, #ff9500, #ffcc00); }
.avatar[data-hue="6"] { background: linear-gradient(135deg, #5856d6, #bf5af2); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }
