/* ==================================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ ДОКУМЕНТОВ И ЛИЦЕНЗИРОВАНИЯ
   ================================================================== */

:root {
  --primary-blue: #0d6efd;
  --secondary-blue: #1d8ce0;
  --light-blue: #e7f3fd;
  --dark-blue: #0a58ca;
  --gray-light: #f8f9fa;
  --gray-border: #dee2e6;
}

/* Основной контейнер */
.main-content {
  background-color: #f8f9fa;
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* Контейнер документов */
.documents-container {
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

/* ==================================================================
   НАВИГАЦИЯ ПО ДОКУМЕНТАМ
   ================================================================== */

.documents-nav {
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  padding: 1.8rem 1.5rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 100px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.documents-nav:hover {
  box-shadow: 0 20px 50px rgba(13, 110, 253, 0.12);
}

/* Навигационные кнопки */
.nav-pills .nav-link {
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  color: #495057;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.nav-pills .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-pills .nav-link:hover {
  background-color: var(--light-blue);
  border-color: var(--primary-blue);
  transform: translateX(5px);
}

.nav-pills .nav-link:hover::before {
  opacity: 1;
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.25);
  transform: translateX(5px);
}

.nav-pills .nav-link.active::before {
  opacity: 0;
}

.nav-icon {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
  transition: transform 0.3s ease;
}

.nav-pills .nav-link:hover .nav-icon {
  transform: scale(1.1);
}

/* ==================================================================
   ПОИСК
   ================================================================== */

.search-box {
  background: white;
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-input {
  border: 2px solid var(--light-blue) !important;
  border-radius: 14px !important;
  padding: 0.9rem 1.2rem !important;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.search-input:focus {
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1) !important;
  outline: none;
}

.input-group-text {
  border-radius: 14px 0 0 14px !important;
  background: #f8f9fa;
  border: 2px solid var(--light-blue) !important;
  border-right: none !important;
  padding: 0 1.2rem;
}

.search-box .btn-primary {
  border-radius: 0 14px 14px 0 !important;
  padding: 0 2rem;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.search-box .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

/* ==================================================================
   СЕКЦИИ ДОКУМЕНТОВ
   ================================================================== */

.documents-section {
  background: white;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
  padding: 2.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Заголовок секции */
.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-blue);
}

.section-icon {
  font-size: 2.5rem;
  color: var(--primary-blue);
  background: var(--light-blue);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(13, 110, 253, 0.15);
}

.documents-section:hover .section-icon {
  transform: rotate(5deg) scale(1.05);
  background: var(--primary-blue);
  color: white;
}

/* ==================================================================
   КАРТОЧКИ ЛИЦЕНЗИЙ
   ================================================================== */

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
  margin: 2rem 0;
}

.license-card {
  background: white;
  border-radius: 20px;
  padding: 2rem 1.8rem;
  border: 1px solid var(--gray-border);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.03);
}

.license-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue));
  transition: width 0.3s ease;
}

.license-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(13, 110, 253, 0.15);
  border-color: var(--primary-blue);
}

.license-card:hover::before {
  width: 8px;
}

.license-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.license-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #2c3e50;
  font-size: 1.2rem;
  line-height: 1.5;
  padding-right: 80px;
}

.license-view-btn {
  background: var(--light-blue);
  color: var(--primary-blue);
  border: none;
  padding: 0.9rem 1.5rem;
  border-radius: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.license-view-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.license-view-btn:hover {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(13, 110, 253, 0.3);
}

.license-view-btn:hover::before {
  width: 200px;
  height: 200px;
}

.license-view-btn i {
  transition: transform 0.3s ease;
}

.license-view-btn:hover i {
  transform: translateX(3px);
}

/* ==================================================================
   ТАЙМЛАЙН ДОКУМЕНТОВ
   ================================================================== */

.document-timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.document-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue));
  border-radius: 3px;
  opacity: 0.5;
}

.timeline-year {
  position: relative;
  margin-bottom: 2rem;
  animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: -2.3rem;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border: 4px solid white;
  box-shadow: 0 0 0 3px var(--light-blue);
  z-index: 2;
  transition: all 0.3s ease;
}

.timeline-year:hover::before {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px var(--light-blue);
}

.year-header {
  background: linear-gradient(135deg, var(--light-blue), #f0f9ff);
  padding: 1.2rem 1.8rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(13, 110, 253, 0.1);
}

.year-header:hover {
  background: linear-gradient(135deg, #d1e7fd, #c0dcfd);
  transform: translateX(5px);
}

.year-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  color: var(--primary-blue);
}

/* Карточка документа */
.document-item-card {
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.document-item-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.document-item-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.1);
  transform: translateX(5px);
}

.document-item-card:hover::after {
  opacity: 1;
}

.document-icon {
  font-size: 1.8rem;
  color: var(--primary-blue);
  min-width: 50px;
  height: 50px;
  background: var(--light-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: all 0.3s ease;
}

.document-item-card:hover .document-icon {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  transform: rotate(5deg) scale(1.05);
}

.document-info {
  flex-grow: 1;
}

.document-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  line-height: 1.4;
}

.document-meta {
  display: flex;
  gap: 1.2rem;
  color: #6c757d;
  font-size: 0.8rem;
}

.document-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.document-meta i {
  color: var(--primary-blue);
}

.document-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--light-blue);
  color: var(--primary-blue);
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1.1rem;
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 15px rgba(13, 110, 253, 0.2);
}

/* ==================================================================
   КАРТОЧКА ПРОЕКТА СЗЗ
   ================================================================== */

.szz-project-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 24px;
  padding: 2.5rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.szz-project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.1;
  animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(-50px) translateY(-50px);
  }
}

.szz-content {
  position: relative;
  z-index: 1;
}

.szz-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ==================================================================
   АЛЕРТЫ И УВЕДОМЛЕНИЯ
   ================================================================== */

.alert-info {
  background: linear-gradient(135deg, var(--light-blue), #f0f9ff);
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  border-left: 5px solid var(--primary-blue);
  margin-bottom: 2rem;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.08);
}

.alert-success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border: none;
  border-radius: 16px;
  padding: 1.8rem;
  border-left: 5px solid #28a745;
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.1);
}

.alert-success .btn-outline-success {
  border: 2px solid white;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.alert-success .btn-outline-success:hover {
  background: white;
  color: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* ==================================================================
   КАРТОЧКИ ПРОВЕРКИ
   ================================================================== */

.card {
  border-radius: 20px !important;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03) !important;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(13, 110, 253, 0.1) !important;
}

.card-body {
  padding: 2rem !important;
}

.card-title {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--primary-blue);
  font-size: 1.3rem;
}

.card-text {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.card .btn-outline-primary {
  border: 2px solid var(--primary-blue);
  border-radius: 30px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.card .btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(13, 110, 253, 0.2);
}

/* QR-код контейнер */
.bg-light.rounded {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  padding: 2rem !important;
  border-radius: 20px !important;
  transition: all 0.3s ease;
}

.bg-light.rounded:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.bi-qr-code {
  color: #2c3e50;
  animation: pulse 2s infinite;
}

/* ==================================================================
   КНОПКИ
   ================================================================== */

.btn-outline-primary {
  border: 2px solid var(--primary-blue);
  border-radius: 30px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--primary-blue);
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
  border-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border: none;
  border-radius: 30px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 200px;
  height: 200px;
}

/* ==================================================================
   АДАПТИВНОСТЬ
   ================================================================== */

@media (max-width: 1199.98px) {
  .license-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 991.98px) {
  .documents-container {
    margin-top: -20px;
  }
  
  .documents-nav {
    position: static;
    margin-bottom: 2rem;
    padding: 1.5rem;
  }
  
  .section-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .license-grid {
    grid-template-columns: 1fr;
  }
  
  .document-item-card {
    flex-wrap: wrap;
  }
  
  .document-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .szz-project-card {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .documents-section {
    padding: 1.8rem;
  }
  
  .section-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }
  
  .license-card {
    padding: 1.5rem;
  }
  
  .license-title {
    font-size: 1.1rem;
    padding-right: 60px;
  }
  
  .document-timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-year::before {
    left: -1.8rem;
  }
  
  .year-header {
    padding: 1rem;
    font-size: 0.95rem;
  }
  
  .document-item-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  
  .document-icon {
    margin-bottom: 0.5rem;
  }
  
  .document-actions {
    justify-content: flex-start;
  }
  
  .card-body {
    padding: 1.5rem !important;
  }
  
  .szz-project-card {
    padding: 1.5rem;
  }
  
  .szz-icon {
    font-size: 3rem;
  }
}

@media (max-width: 576px) {
  .documents-section {
    padding: 1.2rem;
  }
  
  .section-header {
    margin-bottom: 1.5rem;
  }
  
  .section-icon {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }
  
  .license-card {
    padding: 1.2rem;
  }
  
  .license-badge {
    top: 15px;
    right: 15px;
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }
  
  .license-title {
    font-size: 1rem;
    padding-right: 50px;
  }
  
  .document-meta {
    flex-direction: column;
    gap: 0.3rem;
  }
  
  .action-btn {
    width: 38px;
    height: 38px;
  }
  
  .search-box {
    padding: 1rem;
  }
  
  .search-input {
    padding: 0.7rem 1rem !important;
  }
}

/* Для пользователей с чувствительностью к анимациям */
@media (prefers-reduced-motion: reduce) {
  .documents-section,
  .documents-nav,
  .license-card,
  .document-item-card,
  .szz-project-card,
  .btn-primary,
  .action-btn {
    animation: none;
    transition: none;
  }
  
  .license-card:hover,
  .document-item-card:hover,
  .action-btn:hover {
    transform: none;
  }
  
  .szz-project-card::before {
    animation: none;
  }
  
  .szz-icon {
    animation: none;
  }
  
  .license-badge {
    animation: none;
  }
}