/* Современные стили поверх базовых */

/* Hero Section - Modern */
.hero {
  position: relative;
  overflow: hidden;
  padding: 10rem 1.5rem 12rem;
  background: transparent;
  color: white;
  text-align: center;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #fff 0%, #667eea 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  font-size: 1.5rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  line-height: 1.8;
  min-height: 60px;
}

.typed-cursor {
  color: var(--color-accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Glassmorphism Cards */
.subject-card,
.content-card,
.announcement-card,
.fun-fact,
.reviews-info-card {
  background: rgba(22, 33, 62, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.2) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37) !important;
}

.subject-card:hover,
.content-card:hover,
.announcement-card:hover,
.fun-fact:hover,
.reviews-info-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4) !important;
  border-color: var(--color-accent) !important;
}

/* Section Titles with Gradient */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

/* Quick Links - Modern Buttons */
.quick-link {
  background: var(--gradient-primary) !important;
  border: none !important;
  color: white !important;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.quick-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.quick-link:hover::before {
  left: 100%;
}

.quick-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* Achievements Section - Modern */
.achievements-compact {
  background: rgba(22, 33, 62, 0.5) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(102, 126, 234, 0.2);
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.achievement-stat-number {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 4rem;
  font-weight: 800;
}

/* Announcements - Modern */
.announcements-section {
  background: transparent !important;
}

.announcement-card::before {
  background: var(--gradient-accent);
}

/* Fun Facts - Neon Effect */
.fun-fact {
  position: relative;
  overflow: hidden;
}

.fun-fact::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.fun-fact:hover::after {
  opacity: 1;
}

.fun-fact-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 10px rgba(240, 147, 251, 0.5));
}

/* Footer - Modern */
.footer {
  background: rgba(15, 15, 35, 0.9) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

/* Reviews Page - Modern */
.reviews-intro {
  background: rgba(22, 33, 62, 0.7) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37) !important;
}

.reviews-intro-title {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Page Hero - Modern */
.page-hero {
  background: rgba(22, 33, 62, 0.7) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

/* Floating Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.subject-card-icon {
  animation: float 3s ease-in-out infinite;
}

/* Pulse Animation for Icons */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.reviews-info-icon,
.fun-fact-icon {
  animation: pulse 2s ease-in-out infinite;
}

/* Glow Effect on Hover */
.subject-card:hover .subject-card-icon,
.reviews-info-card:hover .reviews-info-icon {
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.8));
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}


/* ========== Animated SVG Icons in Hero ========== */

/* DNA Strand Animation */
.decor-dna .dna-strand {
  animation: dna-rotate 4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes dna-rotate {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

/* Flask Bubble Animation */
.flask-bubble {
  animation: bubble-rise 2s ease-in-out infinite;
}

@keyframes bubble-rise {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-10px); opacity: 0.6; }
}

/* Leaf Sway Animation */
.decor-leaf {
  animation: leaf-sway 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes leaf-sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* Molecule Rotation */
.molecule-atoms {
  animation: molecule-spin 6s linear infinite;
  transform-origin: center;
}

@keyframes molecule-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Atom Orbits */
.atom-orbits {
  animation: atom-pulse 3s ease-in-out infinite;
}

@keyframes atom-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Electron Orbit Animation */
.electron {
  animation: electron-orbit 3s linear infinite;
}

@keyframes electron-orbit {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Enhanced Hero Decor Positioning */
.decor-dna {
  bottom: 18%;
  right: 10%;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
}

.decor-flask {
  top: 48%;
  left: 14%;
  filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.6));
}

.decor-leaf {
  bottom: 22%;
  left: 18%;
  filter: drop-shadow(0 0 20px rgba(107, 196, 145, 0.6));
}

.decor-molecule {
  top: 35%;
  right: 15%;
  filter: drop-shadow(0 0 20px rgba(240, 147, 251, 0.6));
}

.decor-atom {
  top: 12%;
  left: 8%;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
}

/* Hover Effects for SVG Icons */
.hero-decor svg:hover {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}


/* ========== SVG Icons Styling ========== */

/* Subject Card Icons */
.subject-card-icon svg {
  color: inherit;
  transition: all var(--transition);
}

.subject-card.chemistry .subject-card-icon svg {
  color: #4facfe;
}

.subject-card.biology .subject-card-icon svg {
  color: #6bc491;
}

.subject-card:hover .subject-card-icon svg {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 15px currentColor);
}

/* Fun Fact Icons */
.fun-fact-icon svg {
  color: var(--color-accent);
  transition: all var(--transition);
}

.fun-fact:hover .fun-fact-icon svg {
  transform: scale(1.15) rotate(10deg);
  filter: drop-shadow(0 0 20px var(--color-accent));
}

/* Reviews Icons */
.reviews-intro-icon svg {
  color: var(--color-accent);
  filter: drop-shadow(0 0 15px rgba(240, 147, 251, 0.5));
  animation: icon-float 3s ease-in-out infinite;
}

.reviews-info-icon svg {
  color: var(--color-accent);
  transition: all var(--transition);
}

.reviews-info-card:hover .reviews-info-icon svg {
  transform: scale(1.2) rotate(10deg);
  filter: drop-shadow(0 0 20px var(--color-accent));
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* General SVG Icon Enhancements */
.subject-card-icon,
.fun-fact-icon,
.reviews-info-icon,
.reviews-intro-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ========== Quick Link Icons ========== */
.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-link-icon {
  flex-shrink: 0;
  transition: all var(--transition);
}

.quick-link:hover .quick-link-icon {
  transform: scale(1.1) translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

/* ========== Announcements Icon ========== */
.announcements-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.announcements-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  animation: bell-ring 2s ease-in-out infinite;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}

/* ========== Content Card Image Icons ========== */
.content-card-image svg {
  color: var(--color-accent);
  transition: all var(--transition);
}

.content-card:hover .content-card-image svg {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 15px var(--color-accent));
}

/* ========== About Photo Icon ========== */
.about-photo svg {
  color: var(--color-accent);
  filter: drop-shadow(0 0 20px rgba(240, 147, 251, 0.5));
  animation: icon-float 3s ease-in-out infinite;
}

/* ========== Hero Decor SVG Positioning (for chemistry/biology pages) ========== */
.hero-decor .decor-dna,
.hero-decor .decor-flask,
.hero-decor .decor-leaf,
.hero-decor .decor-molecule {
  position: absolute;
  opacity: 0.6;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.5));
}

.hero-decor .decor-dna {
  top: 15%;
  right: 10%;
  animation: dna-rotate 4s ease-in-out infinite;
}

.hero-decor .decor-flask {
  top: 45%;
  left: 8%;
  animation: float 3s ease-in-out infinite;
}

.hero-decor .decor-leaf {
  bottom: 20%;
  left: 12%;
  animation: leaf-sway 3s ease-in-out infinite;
}

.hero-decor .decor-molecule {
  top: 30%;
  right: 15%;
  animation: molecule-spin 6s linear infinite;
}

/* Responsive - hide decorative SVGs on small screens */
@media (max-width: 768px) {
  .hero-decor .decor-dna,
  .hero-decor .decor-flask,
  .hero-decor .decor-leaf,
  .hero-decor .decor-molecule {
    display: none;
  }
}


/* ========== Cusdis Reviews Widget Styling ========== */
.cusdis-wrapper {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(22, 33, 62, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(31, 38, 135, 0.4);
  position: relative;
  overflow: hidden;
}

.cusdis-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

/* Стилизация iframe Cusdis */
#cusdis_thread iframe {
  width: 100% !important;
  border: none !important;
  border-radius: 8px;
  background: transparent !important;
  min-height: 400px;
}

/* Переопределение стилей Cusdis для темной темы */
#cusdis_thread {
  --cusdis-color-primary: #667eea;
  --cusdis-color-primary-light: rgba(102, 126, 234, 0.1);
  --cusdis-color-text: #e0e7ff;
  --cusdis-color-text-secondary: #a5b4fc;
  --cusdis-color-background: rgba(30, 41, 59, 0.6);
  --cusdis-color-border: rgba(102, 126, 234, 0.2);
  --cusdis-border-radius: 12px;
  --cusdis-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Стили для кнопок внутри Cusdis */
#cusdis_thread button,
#cusdis_thread [type="submit"],
#cusdis_thread .cusdis-button {
  background: var(--gradient-primary) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

#cusdis_thread button:hover,
#cusdis_thread [type="submit"]:hover,
#cusdis_thread .cusdis-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5) !important;
}

/* Кнопка "Ответить" - меньше размером */
#cusdis_thread button:not([type="submit"]),
#cusdis_thread .cusdis-reply-button,
#cusdis_thread [class*="reply"] button {
  padding: 6px 16px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  background: rgba(102, 126, 234, 0.2) !important;
  color: #a5b4fc !important;
  box-shadow: none !important;
  border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

#cusdis_thread button:not([type="submit"]):hover,
#cusdis_thread .cusdis-reply-button:hover,
#cusdis_thread [class*="reply"] button:hover {
  background: rgba(102, 126, 234, 0.3) !important;
  color: #e0e7ff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2) !important;
}

/* Стили для полей ввода */
#cusdis_thread input,
#cusdis_thread textarea {
  border-radius: 10px !important;
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(102, 126, 234, 0.3) !important;
  color: #e0e7ff !important;
  padding: 10px 14px !important;
  transition: all 0.3s ease !important;
}

#cusdis_thread input:focus,
#cusdis_thread textarea:focus {
  border-color: rgba(102, 126, 234, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
  outline: none !important;
}

#cusdis_thread input::placeholder,
#cusdis_thread textarea::placeholder {
  color: #a5b4fc !important;
  opacity: 0.7 !important;
}

/* Дополнительные стили для улучшения видимости */
.cusdis-wrapper {
  color: #e0e7ff;
}

/* Стили для заголовка секции отзывов */
.reviews-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin: 3rem 0 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Анимация появления блока */
.cusdis-wrapper {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Улучшенная видимость для мобильных */
@media (max-width: 768px) {
  .cusdis-wrapper {
    padding: 1.5rem;
    margin-top: 2rem;
  }
  
  .reviews-section-title {
    font-size: 1.5rem;
  }
  
  #cusdis_thread button,
  #cusdis_thread [type="submit"],
  #cusdis_thread .cusdis-button {
    padding: 8px 20px !important;
    font-size: 14px !important;
  }
}

/* Стили для загрузки */
.cusdis-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cusdis-wrapper.loading::after {
  opacity: 1;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Эффект свечения при наведении */
.cusdis-wrapper:hover {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.3), 
              0 0 30px rgba(240, 147, 251, 0.2);
  transition: all 0.3s ease;
}


/* ========== Materials Cards (Google Drive) ========== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.material-card {
  background: rgba(22, 33, 62, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.material-card:hover {
  transform: translateY(-8px);
  border-color: var(--color-accent);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.material-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  transition: all var(--transition);
}

.material-card:hover .material-card-icon {
  background: rgba(102, 126, 234, 0.2);
  transform: scale(1.1);
}

.material-card-icon svg {
  color: var(--color-accent);
  filter: drop-shadow(0 0 10px rgba(240, 147, 251, 0.5));
}

.material-card-body {
  text-align: center;
}

.material-card-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.material-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.material-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.material-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.material-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.material-btn svg {
  flex-shrink: 0;
}

.material-btn-view {
  background: rgba(102, 126, 234, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.material-btn-view:hover {
  background: rgba(102, 126, 234, 0.3);
  color: #e0e7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.material-btn-download {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.material-btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Сообщение "Нет материалов" */
.no-materials {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* Фильтры по классам */
.grade-filters {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.grade-filter-btn {
  padding: 0.7rem 1.5rem;
  background: rgba(22, 33, 62, 0.7);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  color: var(--color-text);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.grade-filter-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.grade-filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Адаптивность */
@media (max-width: 768px) {
  .materials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .material-actions {
    flex-direction: column;
  }
  
  .material-btn {
    width: 100%;
    justify-content: center;
  }
  
  .grade-filters {
    gap: 0.5rem;
  }
  
  .grade-filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}


/* Индикатор загрузки материалов */
.loading-materials {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-materials p {
  color: #e0e7ff;
  font-size: 1rem;
  margin: 0;
}

.no-materials {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #94a3b8;
  font-size: 1.1rem;
}
