/* Базові стилі */
:root {
  --primary: #ff5555;
  --primary-dark: #cc0000;
  --primary-light: #ff8888;
  --dark: #0a0a0a;
  --dark-light: #111111;
  --dark-lighter: #1a1a1a;
  --text: #eee;
  --text-light: #ddd;
  --text-muted: #888;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
}

h1, h2, h3, h4, h5 {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  color: var(--primary);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

h3 {
  font-size: 1.8rem;
  color: var(--primary);
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
header {
  background-color: rgba(17, 17, 17, 0.95);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 80px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
  margin-right: auto;
  padding-left: 10px;
}

.menu {
  display: flex;
  list-style: none;
  margin-left: auto;
}

.menu li {
  position: relative;
}

.menu a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-light);
  transition: var(--transition);
  border-radius: 4px;
  margin: 0 5px;
}

.menu a i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.menu a:hover, .menu a.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
}

.dropdown:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-light);
  list-style: none;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
}

.submenu li a {
  padding: 12px 20px;
  margin: 0;
  border-radius: 0;
  display: block;
}

.submenu li:first-child a {
  border-radius: 8px 8px 0 0;
}

.submenu li:last-child a {
  border-radius: 0 0 8px 8px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  justify-content: space-between;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-light);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
              url('https://images.hdqwalls.com/wallpapers/devil-may-cry-5-4k-5c.jpg') center/cover no-repeat;
  text-align: center;
  color: white;
  margin-top: 80px;
}

.hero-content {
  max-width: 800px;
  padding: 0 20px;
  z-index: 2;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  color: white;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 15px 35px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Story Section */
.story-section {
  background-color: var(--dark-light);
}

.story-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.story-text p {
  font-size: 1.2rem;
}

.story-image {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.story-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: var(--transition);
}

.story-image:hover img {
  transform: scale(1.05);
}

/* Features Section */
.features-section {
  background-color: var(--dark);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  background: var(--dark-light);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-top: 4px solid var(--primary);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-card h3 {
  margin-bottom: 15px;
}

/* Gallery Section */
.gallery-section {
  background-color: var(--dark-light);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 250px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px;
  color: white;
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

/* Links Section */
.links-section {
  background-color: var(--dark);
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  justify-items: center;
}

.link-card {
  background: var(--dark-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  width: 100%;
  max-width: 350px;
}

.link-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.link-card-centered {
  grid-column: span 1;
  justify-self: center;
}

.link-image {
  height: 200px;
  overflow: hidden;
}

.link-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.link-card:hover .link-image img {
  transform: scale(1.1);
}

.link-content {
  padding: 25px;
}

.link-content h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

.link-content p {
  margin-bottom: 20px;
  color: var(--text-light);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 600;
  transition: var(--transition);
}

.link-btn i {
  margin-left: 8px;
  transition: var(--transition);
}

.link-btn:hover {
  background: var(--primary-dark);
}

.link-btn:hover i {
  transform: translateX(5px);
}

/* Facts Section */
.facts-section {
  background-color: var(--dark-light);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.fact-card {
  background: var(--dark);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.fact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.fact-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.fact-card h3 {
  margin-bottom: 15px;
}

/* History Section */
.history-section {
  background-color: var(--dark);
}

.history-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 50px;
  width: 50%;
  padding: 0 40px;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-year {
  position: absolute;
  top: 0;
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
}

.timeline-item:nth-child(odd) .timeline-year {
  right: -40px;
}

.timeline-item:nth-child(even) .timeline-year {
  left: -40px;
}

.timeline-content {
  background: var(--dark-light);
  padding: 25px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.timeline-content h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

/* Characters Section */
.characters-section {
  background-color: var(--dark-light);
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.character-card {
  background: var(--dark);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.character-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.character-image {
  height: 300px;
  overflow: hidden;
}

.character-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.character-card:hover .character-image img {
  transform: scale(1.1);
}

.character-info {
  padding: 25px;
}

.character-info h3 {
  margin-bottom: 10px;
  color: var(--primary);
}

/* Footer */
footer {
  background-color: var(--dark);
  padding: 60px 0 20px;
  border-top: 3px solid var(--primary);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.footer-logo p {
  color: var(--text-muted);
}

.footer-links h4, .footer-social h4 {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 5px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--dark-light);
  border-radius: 50%;
  transition: var(--transition);
  color: var(--text-light);
}

.social-icons a:hover {
  background: var(--primary);
  transform: translateY(-3px);
  color: white;
}

.footer-bottom {
  border-top: 1px solid var(--dark-lighter);
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin-bottom: 5px;
}

/* Анімації */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.8s ease forwards;
}

/* Адаптивність */
@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .characters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.4rem;
  }
  
  .hero h1 {
    font-size: 3.2rem;
  }
  
  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--dark-light);
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    box-shadow: var(--shadow);
  }
  
  .menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .menu li {
    width: 100%;
  }
  
  .menu a {
    margin: 0;
    border-radius: 0;
    padding: 15px 20px;
    border-bottom: 1px solid var(--dark-lighter);
  }
  
  .dropdown:hover .submenu {
    opacity: 0;
    visibility: hidden;
  }
  
  .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--dark);
    border-radius: 0;
    display: none;
  }
  
  .submenu.active {
    display: block;
  }
  
  .hero {
    height: 70vh;
    margin-top: 80px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  section {
    padding: 60px 0;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .story-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .links-grid {
    grid-template-columns: 1fr;
  }
  
  .characters-grid {
    grid-template-columns: 1fr;
  }
  
  .history-timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 0;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-year {
    left: -40px !important;
    right: auto !important;
  }
}

@media (max-width: 480px) {
  .header-container {
    height: 70px;
  }
  
  .logo {
    font-size: 1.5rem;
  }
  
  .hero {
    height: 60vh;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  section {
    padding: 40px 0;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .social-icons {
    justify-content: center;
  }
}

/* Додаткові стилі для покращення UX */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--dark-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

::selection {
  background: var(--primary);
  color: white;
}

.loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loaded {
  opacity: 1;
}

/* Стилі для акордеону FAQ */
details {
  background: var(--dark-light);
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
}

summary {
  padding: 15px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  outline: none;
}

details[open] summary {
  border-bottom: 1px solid var(--dark-lighter);
}

details div {
  padding: 15px 20px;
}

/* Специфічні стилі для вирівнювання */
.link-card:nth-child(4),
.link-card:nth-child(5) {
  grid-column: span 1;
  margin: 0 auto;
}

/* Вирівнювання для парної кількості елементів */
@media (max-width: 1024px) {
  .link-card:nth-child(4),
  .link-card:nth-child(5) {
    grid-column: span 1;
    justify-self: center;
  }
}

@media (max-width: 768px) {
  .link-card:nth-child(4),
  .link-card:nth-child(5) {
    grid-column: span 1;
    justify-self: center;
  }
}