/* Кастомные стили для PWA "Неделя Осознанности 1" */

/* Базовые стили */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 430px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.breathe {
  animation: breathe 4s ease-in-out infinite;
}

/* Таймер */
.timer-circle {
  transition: all 0.3s ease;
  border: 3px solid #e5e7eb;
  position: relative;
}

.timer-circle.active {
  border-color: #4f46e5;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

/* Прогресс бар */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  stroke: #e5e7eb;
  stroke-width: 4;
  fill: transparent;
  stroke-dasharray: 251.2; /* 2π × 40 */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.3s ease;
}

/* Кнопки состояний */
.practice-item {
  transition: all 0.2s ease;
}

.practice-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.practice-item.completed {
  opacity: 0.7;
  background-color: #f0f9ff;
  border-left-color: #22c55e;
}

.practice-item.completed button {
  background-color: #22c55e;
}

/* Техника STOP */
.stop-steps .step {
  transition: all 0.3s ease;
}

.stop-steps .step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Настроение в дневнике */
.mood-btn {
  transition: all 0.2s ease;
}

.mood-btn:hover {
  transform: scale(1.1);
}

.mood-btn.selected {
  border-color: #8b5cf6;
  background-color: #f3e8ff;
  transform: scale(1.05);
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 320px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid #22c55e;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

.notification.info {
  border-left: 4px solid #3b82f6;
}

/* Офлайн индикатор */
.offline-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #f59e0b;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #4f46e5;
  color: white;
  padding: 16px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.install-banner.show {
  transform: translateY(0);
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Высокая контрастность */
@media (prefers-contrast: high) {
  .bg-indigo-100 {
    background-color: #000;
    color: #fff;
  }
  
  .text-indigo-600 {
    color: #000;
  }
  
  .border-gray-300 {
    border-color: #000;
  }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f9fafb;
  }
  
  .bg-white {
    background-color: #374151;
    color: #f9fafb;
  }
  
  .text-gray-800 {
    color: #f9fafb;
  }
  
  .text-gray-600 {
    color: #d1d5db;
  }
  
  .border-gray-300 {
    border-color: #4b5563;
  }
  
  input, textarea, select {
    background-color: #4b5563;
    color: #f9fafb;
    border-color: #6b7280;
  }
  
  input:focus, textarea:focus, select:focus {
    border-color: #8b5cf6;
    ring-color: #8b5cf6;
  }
}

/* Улучшения для мелких экранов */
@media (max-width: 360px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .text-2xl {
    font-size: 1.25rem;
  }
  
  .p-6 {
    padding: 1rem;
  }
  
  .space-y-6 > * + * {
    margin-top: 1rem;
  }
}

/* Landscape ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  .mb-8 {
    margin-bottom: 1rem;
  }
  
  .py-6 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Focus styles для доступности */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Увеличенные области нажатия для мобильных */
@media (pointer: coarse) {
  button {
    min-height: 44px;
  }
  
  .mood-btn {
    min-width: 44px;
    min-height: 44px;
  }
}