/* Стили для секции избранных мероприятий с flip-карточками */
.featured-events {
  background: rgba(0, 0, 0, 0.5);
  padding: 30px;
  border-radius: 20px;
  margin-top: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-events h2 {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.8em;
  color: #ffdd59;
  text-align: center;
}

/* Контейнер для карточек */
.flip-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Базовые стили flip-карточки */
.flip-card {
  perspective: 1000px;
  height: 480px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Общие стили для обеих сторон */
.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
}

/* Лицевая сторона */
.flip-card-front {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
}

.event-image {
  height: 55%;
  overflow: hidden;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.flip-card:hover .event-image img {
  transform: scale(1.05);
}

.event-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 0;
}

.event-info h3 {
  color: #ffdd59;
  margin-bottom: 10px;
  font-size: 1.3em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-wrap: break-word;
}

.event-date {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.event-date::before {
  content: '📅';
  font-size: 0.8em;
}

.event-short-desc {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95em;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-wrap: break-word;
  flex: 1;
  min-height: 0;
}

/* Обратная сторона */
.flip-card-back {
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  transform: rotateY(180deg);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
  min-height: 0;
}

.event-details {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.event-details h3 {
  color: #ffdd59;
  margin-bottom: 15px;
  font-size: 1.3em;
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-wrap: break-word;
}

.event-details p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  margin-bottom: 15px;
  font-size: 0.95em;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 5px;
  word-wrap: break-word;
}

/* Стили для скроллбара в тексте */
.event-details p::-webkit-scrollbar {
  width: 4px;
}

.event-details p::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.event-details p::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.event-features {
  list-style: none;
  margin-bottom: 15px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 150px;
  padding-right: 5px;
}

.event-features::-webkit-scrollbar {
  width: 4px;
}

.event-features::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.event-features::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.event-features li {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  font-size: 0.9em;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-wrap: break-word;
}

.details-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin-top: auto;
}

.details-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Адаптивность */
@media (max-width: 1024px) {
  .flip-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .flip-card {
    height: 460px;
  }
}

@media (max-width: 768px) {
  .featured-events {
    padding: 20px;
  }
  
  .flip-cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 500px;
  }
  
  .flip-card {
    height: 420px;
  }
  
  .event-info {
    padding: 15px;
  }
  
  .flip-card-back {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .featured-events {
    padding: 15px;
  }
  
  .flip-card {
    height: 380px;
  }
  
  .event-info h3 {
    font-size: 1.2em;
  }
  
  .event-details h3 {
    font-size: 1.2em;
  }
  
  .details-btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }
}

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

.flip-card {
  animation: cardAppear 0.6s ease-out;
}

.flip-card:nth-child(2) {
  animation-delay: 0.1s;
}

.flip-card:nth-child(3) {
  animation-delay: 0.2s;
}