:root {
  --neu-bg-primary: #e6e9ef;
  --neu-bg-secondary: #d1d5db;
  --neu-shadow-dark: #b8bcc2;
  --neu-shadow-light: #ffffff;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
}

body.dark {
  --neu-bg-primary: #1e293b;
  --neu-bg-secondary: #0f172a;
  --neu-shadow-dark: #020617;
  --neu-shadow-light: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(145deg, var(--neu-bg-primary), var(--neu-bg-secondary));
  color: var(--text-primary);
  transition: background 0.3s, color 0.2s;
  min-height: 100vh;
}

.app-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 16px 80px;
  min-height: 100vh;
  position: relative;
}

/* Нейроморфные элементы */
.neu-raised {
  background: linear-gradient(145deg, var(--neu-bg-primary), var(--neu-bg-secondary));
  box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
}

.neu-inset {
  background: linear-gradient(145deg, var(--neu-bg-secondary), var(--neu-bg-primary));
  box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light);
}

.neu-btn {
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
  background: linear-gradient(145deg, var(--neu-bg-primary), var(--neu-bg-secondary));
  box-shadow: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light);
  padding: 12px 20px;
  border-radius: 40px;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.neu-btn:active {
  transform: translateY(2px);
  box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), inset -2px -2px 4px var(--neu-shadow-light);
}

.neu-btn-accent {
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
}

/* Формы */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.input-group input, .input-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 32px;
  background: var(--neu-bg-primary);
  box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.input-group input:focus {
  outline: none;
  box-shadow: inset 2px 2px 4px var(--neu-shadow-dark), inset -2px -2px 4px var(--neu-shadow-light), 0 0 0 2px var(--accent);
}

/* Кастомный выпадающий список */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  background: var(--neu-bg-primary);
  box-shadow: inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light);
  padding: 14px 18px;
  border-radius: 32px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  transition: all 0.2s;
}

.custom-select-trigger span:first-child {
  color: var(--text-primary);
}

.custom-select-trigger .arrow {
  transition: transform 0.2s;
  color: var(--accent);
}

.custom-select-trigger.open .arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--neu-bg-primary);
  border-radius: 24px;
  margin-top: 8px;
  box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
  z-index: 10;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.custom-select-dropdown.open {
  max-height: 200px;
}

.custom-select-option {
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-primary);
}

.custom-select-option:hover {
  background: var(--accent);
  color: white;
}

.custom-select-option.selected {
  background: var(--accent);
  color: white;
}

/* Нижняя навигация */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  background: var(--neu-bg-primary);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  padding: 8px 16px 20px;
  border-radius: 32px 32px 0 0;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.2s;
  cursor: pointer;
  padding: 6px;
}

.nav-item.active {
  color: var(--accent);
}

/* Карточки */
.content-card {
  background: var(--neu-bg-primary);
  border-radius: 32px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
  transition: transform 0.2s;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-2px);
}

/* Чипсы тегов */
.tag-chip {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* Офлайн-индикатор */
.offline-badge {
  position: fixed;
  bottom: 80px;
  right: 16px;
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: bold;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Анимация перехода */
.page {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Скелетон */
.skeleton {
  background: linear-gradient(90deg, var(--neu-bg-secondary) 25%, var(--neu-bg-primary) 50%, var(--neu-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 20px;
  height: 20px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* SVG иконки */
.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Toast уведомления */
.toast-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--neu-bg-primary);
  box-shadow: 4px 4px 12px var(--neu-shadow-dark), -4px -4px 12px var(--neu-shadow-light);
  border-radius: 60px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transition: transform 0.3s ease;
  max-width: 90%;
  font-size: 14px;
  font-weight: 500;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.toast-success .toast-icon {
  background: #10b981;
  color: white;
}

.toast-error .toast-icon {
  background: #ef4444;
  color: white;
}

.toast-warning .toast-icon {
  background: #f59e0b;
  color: white;
}

.toast-info .toast-icon {
  background: var(--accent);
  color: white;
}

.toast-message {
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 4px;
}

.toast-close:hover {
  color: var(--accent);
}