/* ==============================
   Modern Game Hub - Main Styles
   ============================== */

:root {
  --primary-color: #6a11cb;
  --secondary-color: #2575fc;
  --accent-color: #ff2d75;
  --dark-color: #0f0c29;
  --light-color: #f8f9fa;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --border-color: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(30, 30, 46, 0.7);
  --transition: all 0.3s ease;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ==============================
   Background Animation
   ============================== */

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

.background-animation {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(106, 17, 203, 0.1);
  animation: float 15s infinite linear;
  filter: blur(20px);
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 5%;
  animation-duration: 25s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  top: 60%;
  left: 80%;
  animation-duration: 20s;
  background: rgba(37, 117, 252, 0.1);
}

.shape-3 {
  width: 150px;
  height: 150px;
  top: 30%;
  left: 70%;
  animation-duration: 30s;
  background: rgba(255, 45, 117, 0.1);
}

.shape-4 {
  width: 250px;
  height: 250px;
  top: 70%;
  left: 15%;
  animation-duration: 35s;
  background: rgba(106, 17, 203, 0.1);
}

.shape-5 {
  width: 180px;
  height: 180px;
  top: 40%;
  left: 40%;
  animation-duration: 28s;
  background: rgba(37, 117, 252, 0.1);
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 20px) rotate(90deg);
  }
  50% {
    transform: translate(0, 40px) rotate(180deg);
  }
  75% {
    transform: translate(-20px, 20px) rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

/* ==============================
   Main Container
   ============================== */

.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ==============================
   Header Styles
   ============================== */

.modern-header {
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  margin-right: 10px;
  color: var(--accent-color);
  animation: pulse 2s infinite;
}

.logo-text span {
  color: var(--accent-color);
}

@keyframes pulse {
  0% {
    text-shadow: 0 0 5px rgba(255, 45, 117, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 45, 117, 0.8);
  }
  100% {
    text-shadow: 0 0 5px rgba(255, 45, 117, 0.5);
  }
}

.main-nav .nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 0 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-link:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  transition: var(--transition);
  z-index: -1;
  opacity: 0;
}

.nav-link:hover:before,
.nav-link.active:before {
  left: 0;
  opacity: 1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-link i {
  margin-right: 8px;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
}

.search-container {
  margin-right: 20px;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 30px 0 0 30px;
  background: rgba(30, 30, 30, 0.7);
  color: var(--text-primary);
  width: 250px;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 45, 117, 0.3);
  width: 300px;
}

.search-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 30px 30px 0;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--gradient-secondary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(106, 17, 203, 0.3);
}

.user-actions {
  display: flex;
  align-items: center;
}

/* Theme toggle button */
.theme-toggle {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.2);
}


#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1);
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.3);
}

#backToTop:active {
    transform: scale(0.95);
}

/* User menu button */
.user-menu-btn {
    background: linear-gradient(45deg, #782df0, #0a5ebe);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.2);
}

/* ==============================
   Main Content
   ============================== */

.main-content {
  flex: 1;
  padding: 40px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==============================
   Page Title
   ============================== */

.page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 40px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(106, 17, 203, 0.3);
  position: relative;
}

.page-title:after {
  content: '';
  display: block;
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  margin: 15px auto;
  border-radius: 2px;
}

/* ==============================
   Game Cards
   ============================== */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.game-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  transform: translateY(0);
}

.game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.game-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.game-card:hover .game-card-image {
  transform: scale(1.05);
}

.game-card-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent-color);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(255, 45, 117, 0.3);
}

.game-card-content {
  padding: 20px;
}

.game-card-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(106, 17, 203, 0.2);
  color: #d0c9ff;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.game-card-rating {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.rating-stars {
  color: #f8b400;
  margin-right: 10px;
}

.rating-value {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.game-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transform: scale(1);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  flex: 1;
}

.btn-primary:hover {
  background: var(--gradient-secondary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.btn-primary:active {
  transform: translateY(-2px) scale(0.95);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  flex: 1;
}

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

.btn-secondary:active {
  transform: translateY(-2px) scale(0.95);
}

.btn i {
  margin-right: 5px;
}

/* ==============================
   Ripple Effect for Buttons
   ============================== */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* ==============================
   Pagination
   ============================== */

.pagination {
  display: flex;
  justify-content: center;
  margin: 50px 0 30px;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  transform: scale(1);
  position: relative;
  overflow: hidden;
}

.pagination-btn:hover,
.pagination-btn.active {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.pagination-btn:active {
  transform: translateY(-3px) scale(0.95);
}

/* ==============================
   Footer Styles
   ============================== */

.modern-footer {
  background: rgba(18, 18, 18, 0.9);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  backdrop-filter: blur(10px);
  position: relative;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-family: 'Orbitron', sans-serif;
  display: flex;
  align-items: center;
}

.footer-logo i {
  margin-right: 10px;
  color: var(--accent-color);
}

.footer-description {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.social-link:hover {
  background: var(--gradient-primary);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.footer-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 10px;
}

.footer-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

.footer-links a:before {
  content: '»';
  margin-right: 10px;
  color: var(--accent-color);
}

.newsletter-description {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-input {
  flex: 1;
  padding: 12px 15px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 45, 117, 0.3);
}

.newsletter-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.newsletter-btn:hover {
  background: var(--gradient-secondary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.footer-bottom i {
  color: var(--danger-color);
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  5% { transform: scale(1.2); }
  10% { transform: scale(1); }
  15% { transform: scale(1.2); }
  20% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* ==============================
   Responsive Design
   ============================== */

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .logo-section {
    justify-content: center;
    width: 100%;
  }
  
  .main-nav {
    width: 100%;
  }
  
  .nav-list {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav-item {
    margin: 5px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
  }
  
  .search-container {
    width: 100%;
    max-width: 300px;
    margin-right: 10px;
  }
  
  .search-input {
    width: 100%;
    padding: 8px 12px;
  }
  
  .search-input:focus {
    width: 100%;
  }
  
  .search-btn {
    padding: 8px 15px;
  }
  
  .theme-toggle,
  .user-menu-btn {
    width: 35px;
    height: 35px;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .featured-games {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-input {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    padding: 30px 0;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .search-container {
    max-width: 200px;
  }
  
  .search-input {
    width: 150px;
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .nav-link i {
    margin-right: 5px;
    font-size: 0.8rem;
  }
}