/* DataLife Engine Template - Minimalist Design */

/* CSS Variables - Цветовая палитра */
:root {
  /* Primary Colors - Основной цвет */
  --primary: #6673d6;
  --primary-dark: #212e8b;
  --primary-light: #a7afeb;
  --primary-medium: #8e99eb;
  --primary-alt: #6269a1;

  /* Secondary A - Вторичный цвет A */
  --secondary-a: #8b61d5;
  --secondary-a-dark: #471f8b;
  --secondary-a-light: #bea4ea;
  --secondary-a-medium: #ad8aea;
  --secondary-a-alt: #765ea0;

  /* Secondary B - Вторичный цвет B */
  --secondary-b: #58a8cf;
  --secondary-b-dark: #1d6486;
  --secondary-b-light: #9ecfe7;
  --secondary-b-medium: #84c6e7;
  --secondary-b-alt: #58859b;

  /* Accent - Дополнительный цвет */
  --accent: #ffd465;
  --accent-dark: #a68121;
  --accent-light: #ffe8aa;
  --accent-medium: #ffdf8c;
  --accent-alt: #bfa769;

  /* Base colors */
  --bg-color: #ffffff;
  --text-color: #1a1a2e;
  --border-color: #e5e7eb;
  --muted-bg: #f5f6fa;
  --muted-text: #6b7280;

  /* Radius */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary-b);
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

/* Стили для логотипа-изображения */
.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.site-logo:hover {
  opacity: 0.9;
}

.header-search {
  flex: 1;
  max-width: 500px;
}

.search-form {
  position: relative;
  display: flex;
}

.search-form input {
  width: 100%;
  padding: 0.625rem 1rem;
  padding-right: 2.5rem;
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-form input:focus {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-form button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.search-form button:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* User Profile (для залогиненных) */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-notifications {
  position: relative;
  cursor: pointer;
}

.notification-icon {
  width: 20px;
  height: 20px;
  color: white;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.notification-icon:hover {
  opacity: 1;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: var(--text-color);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.user-menu:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}

/* Guest Actions (для незалогиненных) */
.guest-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-color);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Main Layout - 3 колонки */
.site-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 250px 1fr 300px;
  gap: 2rem;
  align-items: start;
}

/* Sidebar Navigation - Колонка 1 */
.sidebar-nav {
  position: sticky;
  top: 90px;
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.nav-section {
  padding: 1.5rem 0;
}

.nav-section:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-text);
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-color);
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  background: var(--muted-bg);
  color: var(--primary);
}

.nav-link.active {
  background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  opacity: 1;
}

/* Main Content - Колонка 2 */
.main-content {
  min-height: 600px;
}

/* Article Card */
.article-card {
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.article-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-light);
}

.article-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.article-category {
  background: var(--secondary-a-light);
  color: var(--secondary-a-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
}

.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-title a {
  color: var(--text-color);
}

.article-title a:hover {
  color: var(--primary);
}

.article-excerpt {
  color: var(--muted-text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted-text);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Widgets Sidebar - Колонка 3 */
.widgets-sidebar {
  position: sticky;
  top: 90px;
}

.widget {
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.widget-list {
  list-style: none;
}

.widget-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.widget-list li:last-child {
  border-bottom: none;
}

.widget-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
}

.widget-list a:hover {
  color: var(--primary);
}

.widget-count {
  background: var(--muted-bg);
  color: var(--muted-text);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Tags Widget */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--muted-bg);
  color: var(--text-color);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.tag:hover {
  background: var(--secondary-b);
  color: white;
  border-color: var(--secondary-b);
  transform: translateY(-2px);
}

/* Stats Widget */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-box {
  background: var(--muted-bg);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

/* Стили для виджета мини-профиля */
/* User Widget */
.user-widget {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-a-light) 100%);
  border: none !important;
}

.user-widget .widget-title {
  border-color: var(--primary-dark);
  color: var(--text-color);
}

/* Добавляем стили для формы входа в виджете */
.login-widget {
  padding: 0;
}

.login-widget .widget-title {
  margin-bottom: 1.25rem;
}

.login-widget form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-widget .form-group {
  margin-bottom: 0;
}

.login-widget .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.375rem;
}

.login-widget .form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: white;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.login-widget .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 115, 214, 0.1);
}

.login-widget .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.login-widget .form-check-input {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.login-widget .form-check-label {
  font-size: 0.85rem;
  color: var(--text-color);
  cursor: pointer;
  margin: 0;
}

.login-widget .btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.login-widget .btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 115, 214, 0.3);
}

.login-widget .btn-block {
  display: block;
  width: 100%;
}

.login-widget .login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
}

.login-widget .register-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-widget .register-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.login-widget .forgot-link {
  color: var(--muted-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-widget .forgot-link:hover {
  color: var(--text-color);
  text-decoration: underline;
}

/* Социальные сети для входа */
.login-widget .social-login {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vk-btn {
  background: #0077ff;
  color: white;
}

.ok-btn {
  background: #ee8208;
  color: white;
}

.fb-btn {
  background: #1877f2;
  color: white;
}

.google-btn {
  background: #db4437;
  color: white;
}

.mail-btn {
  background: #168de2;
  color: white;
}

.yandex-btn {
  background: #fc3f1d;
  color: white;
}

/* Обновляем стили мини-профиля */
.profile-widget {
  padding: 0;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-avatar {
  position: relative;
}

.profile-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid white;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
}

.user-status.online {
  background: #10b981;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
}

.profile-group {
  font-size: 0.8rem;
  color: var(--primary-dark);
  font-weight: 500;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-item {
  background: white;
  padding: 0.875rem;
  border-radius: var(--radius);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
  display: block;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.action-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: var(--radius);
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.action-link:hover {
  background: var(--primary);
  color: white;
  transform: translateX(4px);
}

.action-link i,
.action-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.action-link:hover i,
.action-link:hover svg {
  opacity: 1;
}

.action-link.admin-link {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--text-color);
  font-weight: 600;
}

.action-link.admin-link:hover {
  transform: translateX(4px) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-logout {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--text-color);
  color: white;
  text-align: center;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Форма входа в виджете */
.login-widget-form .form-group {
  margin-bottom: 1rem;
}

.login-widget-form .form-label {
  font-size: 0.85rem;
  color: var(--text-color);
}

.login-widget-form .form-input {
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  background: white;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-color);
}

.form-checkbox input[type="checkbox"] {
  cursor: pointer;
}

.login-widget-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.form-link-primary {
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-link-primary:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Мини-профиль пользователя */
.user-widget-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.user-widget-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid white;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-widget-info {
  flex: 1;
}

.user-widget-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
}

.user-widget-role {
  font-size: 0.85rem;
  color: var(--primary-dark);
  font-weight: 500;
}

.user-widget-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.user-stat {
  background: white;
  padding: 0.875rem;
  border-radius: var(--radius);
  text-align: center;
}

.user-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.user-stat-label {
  font-size: 0.75rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

.user-widget-actions {
  display: grid;
  gap: 0.5rem;
}

.btn-widget {
  display: block;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  text-align: center;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-widget:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-widget-outline {
  display: block;
  padding: 0.75rem;
  background: transparent;
  color: var(--text-color);
  text-align: center;
  border: 2px solid var(--text-color);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-widget-outline:hover {
  background: var(--text-color);
  color: white;
}

/* Login Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  backdrop-filter: blur(5px); /* Corrected and completed line */
}
