/* Стили для страницы результатов */

/* Основной контент */
.results-main {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 100px 0 40px;
}

/* Заголовок результатов */
.results-header {
  text-align: center;
  margin-bottom: 60px;
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease;
}

.header-content {
  margin-bottom: 40px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 1s ease;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.results-header h1 {
  font-size: 2.5rem;
  color: var(--dark-gray);
  margin-bottom: 16px;
}

.results-header p {
  font-size: 1.25rem;
  color: var(--gray);
}

.highlight {
  color: var(--primary-color);
  font-weight: 700;
}

/* Сводка анализа */
.analysis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--light-gray);
  border-radius: var(--border-radius-small);
}

.summary-icon {
  font-size: 2rem;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 4px;
}

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

/* Карточка информации о бизнесе */
.business-info-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.business-info-card h2 {
  color: var(--dark-gray);
  margin-bottom: 24px;
  font-size: 1.5rem;
}

.business-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--light-gray);
}

.detail-label {
  font-weight: 500;
  color: var(--gray);
}

.detail-value {
  font-weight: 600;
  color: var(--dark-gray);
}

/* Фильтры */
.filters-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease 0.4s both;
}

.filters-section h2 {
  color: var(--dark-gray);
  margin-bottom: 24px;
  font-size: 1.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 500;
  color: var(--dark-gray);
  font-size: 14px;
}

.filter-group select {
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: var(--border-radius-small);
  background: var(--white);
  font-size: 14px;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 196, 0.1);
}

/* Секция программ */
.programs-section {
  margin-bottom: 60px;
  animation: fadeInUp 0.6s ease 0.6s both;
}

.programs-section h2 {
  color: var(--dark-gray);
  margin-bottom: 32px;
  font-size: 1.75rem;
  text-align: center;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

/* Карточка программы */
.program-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.program-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: var(--transition);
}

.program-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.program-card:hover::before {
  transform: scaleX(1);
}

.program-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 16px;
}

.program-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 8px;
  line-height: 1.3;
  padding-right: 120px;
}

.match-score {
  background: var(--success-color);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  position: static;
}

.match-score.high {
  background: var(--success-color);
}

.match-score.medium {
  background: var(--warning-color);
}

.match-score.low {
  background: var(--gray);
}

.program-organizer {
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.program-description {
  color: var(--gray);
  margin-bottom: 20px;
  line-height: 1.5;
}

.program-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.program-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.detail-icon {
  font-size: 16px;
}

.detail-text {
  color: var(--dark-gray);
}

.program-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.program-tag {
  background: rgba(0, 123, 196, 0.1);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.program-actions {
  display: flex;
  gap: 12px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: var(--border-radius-small);
}

/* AI рекомендации */
.ai-recommendations {
  margin-bottom: 60px;
  animation: fadeInUp 0.6s ease 0.8s both;
}

.ai-recommendations h2 {
  color: var(--dark-gray);
  margin-bottom: 32px;
  font-size: 1.75rem;
  text-align: center;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.recommendation-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

.rec-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.recommendation-card h3 {
  color: var(--dark-gray);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.recommendation-card p {
  color: var(--gray);
  line-height: 1.5;
  margin: 0;
}

/* Следующие шаги */
.next-steps {
  margin-bottom: 60px;
  animation: fadeInUp 0.6s ease 1s both;
}

.next-steps h2 {
  color: var(--dark-gray);
  margin-bottom: 32px;
  font-size: 1.75rem;
  text-align: center;
}

.steps-timeline {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow);
  position: relative;
}

.steps-timeline::before {
  content: '';
  position: absolute;
  left: 50px;
  top: 80px;
  bottom: 80px;
  width: 2px;
  background: var(--light-gray);
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
  position: relative;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-content h3 {
  color: var(--dark-gray);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.step-content p {
  color: var(--gray);
  margin: 0;
}

/* Ресурсы */
.resources-section {
  margin-bottom: 60px;
  animation: fadeInUp 0.6s ease 1.2s both;
}

.resources-section h2 {
  color: var(--dark-gray);
  margin-bottom: 32px;
  font-size: 1.75rem;
  text-align: center;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.resource-card h3 {
  color: var(--dark-gray);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.resource-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-card li {
  margin-bottom: 8px;
}

.resource-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.resource-card a:hover {
  text-decoration: underline;
}

/* CTA секция */
.cta-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease 1.4s both;
}

.cta-content h2 {
  color: var(--dark-gray);
  margin-bottom: 16px;
  font-size: 1.75rem;
}

.cta-content p {
  color: var(--gray);
  margin-bottom: 32px;
  font-size: 1.1rem;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Модальное окно */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--light-gray);
}

.modal-header h2 {
  margin: 0;
  color: var(--dark-gray);
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--light-gray);
}

.modal-body {
  padding: 24px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  color: var(--dark-gray);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.detail-section p,
.detail-section div {
  color: var(--gray);
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--light-gray);
  justify-content: flex-end;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Загрузочные состояния */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .results-main {
    padding: 90px 0 20px;
  }
  
  .results-header {
    padding: 24px;
    margin-bottom: 40px;
  }
  
  .results-header h1 {
    font-size: 2rem;
  }
  
  .analysis-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .business-info-card,
  .filters-section {
    padding: 24px;
  }
  
  .business-details {
    grid-template-columns: 1fr;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .programs-grid {
    grid-template-columns: 1fr;
  }
  
  .recommendations-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }
  
  .steps-timeline {
    padding: 24px;
  }
  
  .steps-timeline::before {
    left: 30px;
  }
  
  .timeline-step {
    gap: 16px;
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-actions .btn-large {
    width: 100%;
    max-width: 300px;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .results-header h1 {
    font-size: 1.75rem;
  }
  
  .program-card {
    padding: 16px;
  }
  
  .program-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .program-actions {
    flex-direction: column;
  }
  
  .timeline-step {
    flex-direction: column;
    text-align: center;
  }
  
  .steps-timeline::before {
    display: none;
  }
}

/* Дополнительные эффекты */
.program-card {
  animation: fadeInUp 0.5s ease;
  animation-fill-mode: both;
}

.program-card:nth-child(1) { animation-delay: 0.1s; }
.program-card:nth-child(2) { animation-delay: 0.2s; }
.program-card:nth-child(3) { animation-delay: 0.3s; }
.program-card:nth-child(4) { animation-delay: 0.4s; }
.program-card:nth-child(5) { animation-delay: 0.5s; }
.program-card:nth-child(6) { animation-delay: 0.6s; }

/* Эффекты фильтрации */
.programs-grid.filtering .program-card {
  transition: all 0.3s ease;
}

.programs-grid.filtering .program-card.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

/* Статусы программ */
.program-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.program-status.active {
  background: var(--success-color);
  color: var(--white);
}

.program-status.deadline-soon {
  background: var(--warning-color);
  color: var(--white);
}

.program-status.closed {
  background: var(--gray);
  color: var(--white);
}

/* Контейнер для индикаторов в правом верхнем углу */
.top-right-indicators {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  z-index: 2;
}

/* Анимация для кнопки загрузки PDF */
.btn-primary.generating {
    position: relative;
    pointer-events: none;
    background: linear-gradient(-45deg, #007bc4, #0066a0, #007bc4, #0099e0);
    background-size: 400% 400%;
    animation: pdf-generating 2s ease-in-out infinite;
    color: transparent !important;
}

.btn-primary.generating * {
    opacity: 0 !important;
    visibility: hidden;
}

.btn-primary.generating::before {
    content: '🔄';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
    color: white;
    font-size: 16px;
    opacity: 1;
    visibility: visible;
}

.btn-primary.generating::after {
    content: 'Генерация PDF...';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
}

@keyframes pdf-generating {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Стили для прогресса генерации PDF */
.pdf-progress {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.pdf-progress.show {
    transform: translateX(0);
}

.pdf-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.pdf-progress-icon {
    font-size: 24px;
    animation: bounce 1s ease-in-out infinite;
}

.pdf-progress-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.pdf-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.pdf-progress-text {
    font-size: 12px;
    color: var(--gray);
    text-align: center;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
} 