/* Стили для главной страницы */

/* Hero секция */
.hero-section {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

/* Стили для счетчиков на главной странице */
.hero-section .stat-card {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

.hero-section .stat-card h3 {
  color: white !important;
}

.hero-section .stat-card p {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Кнопки */
.btn {
  border-radius: 10px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  letter-spacing: 0.02em;
  text-transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  border: none;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.25);

}

.btn-success:hover {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  box-shadow: 0 6px 15px rgba(40, 167, 69, 0.35);
}

/* Бейджи */
.badge {
  font-weight: 500;
  border-radius: 6px;
}

/* Теги */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.125rem;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #495057;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.tag:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.tag-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.tag-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
}

.tag-info {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
  color: white;
}

.tag-warning {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #212529;
}

.tag-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

/* Формы */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Модальные окна */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
}

/* Пагинация */
.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  color: #007bff;
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-color: #007bff;
}

/* Алерты */
.alert {
  border-radius: 8px;
  border: none;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Адаптивность */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }

  .hero-section .display-4 {
    font-size: 2rem;
  }

  .app-card:hover,
  .user-card:hover,
  .category-card:hover {
    transform: none;
  }
}

/* Предотвращение layout shift */
.card-img-top-wrapper {
  position: relative;
  overflow: hidden;
}

/* Мобильные улучшения */
@media (max-width: 576px) {
  .hero-section h1 {
    font-size: 2rem !important;
  }

  .hero-section .lead {
    font-size: 1rem !important;
  }

  .app-card .card-title {
    font-size: 0.9rem;
  }

  .app-card .card-text {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .app-card .card-body {
    padding: 0.75rem;
  }

  .rating small {
    font-size: 0.7rem;
  }

  .stat-card {
    padding: 1rem !important;
  }

  .stat-card h3 {
    font-size: 1.25rem !important;
  }
}

/* Улучшения для тач-устройств */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .app-card:hover,
  .category-card:hover,
  .user-card:hover {
    transform: none;
  }

  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* Адаптивные изображения */
img {
  max-width: 100%;
  height: auto;
}

/* Дополнительные утилиты */
.text-shadow {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.box-shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.border-radius-lg {
  border-radius: 12px;
}

.border-radius-xl {
  border-radius: 16px;
}