/* === КРИТИЧЕСКИЕ СТИЛИ ДЛЯ НАВБАРА И ТЕМЫ === */

/* Переменные для тем */
:root {
  --body-bg-light: #f8f9fa;
  --body-bg-dark: #0f0f23;
  --navbar-bg-light: rgba(255, 255, 255, 0.95);
  --navbar-bg-dark: rgba(20, 20, 35, 0.95);
  --text-light: #212529;
  --text-dark: #e6e7ff;
  --accent-primary-light: #2563eb;
  --accent-primary-dark: #6366f1;
}

/* Базовые стили */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--body-bg-light);
  color: var(--text-light);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Навбар */
.modern-navbar {
  background: linear-gradient(135deg, var(--navbar-bg-light) 0%, rgba(248,250,255,0.98) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.9);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Темная тема */
html.dark-mode, body.dark-mode {
  background: var(--body-bg-dark);
  color: var(--text-dark);
}

body.dark-mode .modern-navbar {
  background: linear-gradient(135deg, var(--navbar-bg-dark) 0%, rgba(25,25,45,0.98) 100%);
  border-bottom: 1px solid rgba(130,130,160,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 1px 0 rgba(130,130,160,0.2);
}

/* Контент навбара */
.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Бренд */
.navbar-brand-modern {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1e293b;
  font-weight: 700;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

body.dark-mode .navbar-brand-modern {
  color: #e6e7ff;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-radius: 12px;
  margin-right: 0.75rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
}

body.dark-mode .brand-logo {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.brand-logo img {
  border-radius: 8px;
  filter: brightness(0) invert(1);
}

.brand-text {
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

body.dark-mode .brand-text {
  background: linear-gradient(135deg, #e6e7ff 0%, #a8a9c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Заголовок */
.navbar-title-modern {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease;
}

body.dark-mode .title-text {
  color: #e6e7ff;
}

/* Действия */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.desktop-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Современные кнопки */
.modern-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  color: #64748b;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body.dark-mode .modern-btn {
  background: rgba(45, 45, 65, 0.7);
  color: #a8a9c7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Мобильные кнопки */
.mobile-action-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

body.dark-mode .mobile-action-btn {
  background: rgba(45, 45, 65, 0.95);
  color: #a8a9c7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
}

/* Кнопка переключения темы */
.theme-toggle-btn {
  position: relative;
  overflow: hidden;
}

.theme-icon-dark,
.theme-icon-light {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1rem;
}

.theme-icon-light {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8) rotate(180deg);
}

.theme-icon-dark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* Состояние темной темы */
body.dark-mode .theme-icon-light {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

body.dark-mode .theme-icon-dark {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8) rotate(-180deg);
}

/* Цвета кнопки темы */
.theme-toggle-btn {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

body.dark-mode .theme-toggle-btn {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

/* Адаптивность */
@media (max-width: 767px) {
  .modern-navbar {
    padding: 0.4rem 0.5rem;
    min-height: 60px;
  }
  
  .brand-logo {
    width: 32px;
    height: 32px;
    margin-right: 0.4rem;
    border-radius: 10px;
  }
  
  .brand-text {
    display: none;
  }
  
  .title-text {
    font-size: 0.95rem;
    max-width: 180px;
  }
  
  .modern-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 10px;
  }
  
  .mobile-action-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-radius: 14px;
  }
}

@media (max-width: 575px) {
  .modern-navbar {
    padding: 0.3rem 0.4rem;
    min-height: 56px;
  }
  
  .brand-logo {
    width: 28px;
    height: 28px;
    margin-right: 0.3rem;
    border-radius: 8px;
  }
  
  .title-text {
    font-size: 0.9rem;
    max-width: 140px;
  }
  
  .modern-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border-radius: 8px;
  }
  
  .mobile-action-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 12px;
  }
}