/* ====== General Theme Variables ====== */
:root {
  /* ShatterMC Color Palette */
  --primary-color: #242424;
  --secondary-color: #2a2a2a;
  --secondary-color-light: #363535fd;

  --primary-text-color: #ffffff;
  --secondary-text-color: #cccccc;
  --important-glow: #ffffff;
  --disabled-text: #888888;

  --brand-color: #2c91c0;
  --primary-button-text: #ffffff;
  --primary-button-hover-bg: #b3d7e9;
  --secondary-button-bg: #2a2a2a;
  --secondary-button-hover-bg: #3a3a3a;

  --link-color: #2c91c0;
  --link-hover-color: #b3d7e9;
  --icon-color: #2c91c0;
  --icon-hover-color: #b3d7e9;

  --accent-line: #dddddd;
  --accent-line-alt: #cccccc;
  --glow-effect: 0 0 8px #ffffff;

  --card-bg: #2a2a2a;
  --border-color: #3c3c3c;
  --input-bg: #1e1e1e;
  --input-text: #ffffff;
  --input-border: #444444;
  --input-border-focus: #2c91c0;
  --font-family: 'Poppins', sans-serif;
}

/* ====== Reset & Base Styles ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--primary-text-color);
}

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

/* ====== Header & Nav ====== */
header {
  background: var(--primary-color);
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 1rem 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

header h1, header a {
  color: var(--primary-text-color);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav ul li a {
  text-decoration: none;
  color: var(--primary-text-color);
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--brand-color);
}

/* ====== Hero Section ====== */
.hero {
  background: var(--secondary-color);
  padding: 150px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><pattern id="sparkle" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1" fill="%23ffffff33"/><circle cx="10" cy="10" r="1.5" fill="%232c91c033"/><circle cx="15" cy="5" r="1" fill="%23cccccc26"/></pattern></defs><rect width="100" height="100" fill="url(%23sparkle)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--primary-text-color);
}

.gradient-text {
  background: linear-gradient(45deg, #B8E6FF, #60F4FF, #70ECFF, #A0D4EE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 4rem;
  font-weight: bold;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(20deg); }
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--primary-text-color);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 30px 0;
  flex-wrap: wrap;
}

.server-info {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
  font-size: 1.2rem;
}

.server-ip {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: monospace;
  font-weight: bold;
}

.server-ip-inline {
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 15px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: bold;
}

.players-online {
  background: rgba(0, 255, 0, 0.1);
  padding: 10px 20px;
  border-radius: 8px;
}

/* ====== Buttons ====== */
.btn-primary {
  background: linear-gradient(45deg, var(--brand-color), #1b5f7a);
  color: var(--primary-button-text);
  padding: 16px 38px;
  margin: 10px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 25px rgba(44, 145, 192, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.6s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(44, 145, 192, 0.6);
  background: linear-gradient(45deg, var(--primary-button-hover-bg), var(--brand-color));
}

.btn-secondary {
  background: var(--secondary-button-bg);
  color: var(--primary-text-color);
  padding: 16px 38px;
  margin: 10px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid var(--brand-color);
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--secondary-button-hover-bg);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(44, 145, 192, 0.3);
}

.btn-card {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 30px;
  background: var(--brand-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-card:hover {
  background: #1b5f7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 145, 192, 0.4);
}

/* ====== Stats Section ====== */
#stats {
  padding: 80px 20px;
  background: var(--secondary-color-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  text-align: center;
}

.stat {
  padding: 20px;
}

.counter {
  font-size: 3rem;
  font-weight: bold;
  color: var(--brand-color);
  display: block;
  text-shadow: 0 0 20px rgba(44, 145, 192, 0.5);
}

.stat p {
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  margin-top: 10px;
}

/* ====== Game Modes Section ====== */
#gamemodes {
  padding: 80px 20px;
  background: var(--secondary-color);
}

#gamemodes h2 {
  text-align: center;
  font-size: 2.8rem;
  color: var(--brand-color);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(44, 145, 192, 0.7);
}

.section-subtitle {
  text-align: center;
  color: var(--secondary-text-color);
  margin-bottom: 50px;
  font-size: 1.1rem;
}

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

.gamemode-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.gamemode-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 35px rgba(44, 145, 192, 0.6);
}

.gamemode-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #B8E6FF 0%, #2c91c0 100%);
  color: white;
}

.gamemode-card.featured h3,
.gamemode-card.featured p {
  color: white;
}

.gamemode-card.featured .btn-card {
  background: white;
  color: var(--brand-color);
}

.gamemode-card.featured .btn-card:hover {
  background: #f0f0f0;
}

.gamemode-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.gamemode-card h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--brand-color);
}

.gamemode-card p {
  color: var(--secondary-text-color);
  line-height: 1.6;
  margin-bottom: 20px;
}

.minigames-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.minigames-list span {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
}

/* ====== Updates Section ====== */
#updates {
  padding: 80px 20px;
  background: var(--primary-color);
}

#updates h2 {
  text-align: center;
  font-size: 2.8rem;
  color: var(--brand-color);
  margin-bottom: 50px;
  text-shadow: 0 0 10px rgba(44, 145, 192, 0.7);
}

.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.update-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 12px;
  border-left: 4px solid var(--brand-color);
  transition: transform 0.3s ease;
}

.update-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
}

.update-date {
  color: var(--brand-color);
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 10px;
  display: block;
}

.update-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.update-card p {
  color: var(--secondary-text-color);
  line-height: 1.6;
}

/* ====== Community CTA Section ====== */
#community-cta {
  padding: 80px 20px;
  background: var(--secondary-color-light);
  text-align: center;
}

#community-cta h2 {
  font-size: 2.5rem;
  color: var(--brand-color);
  margin-bottom: 20px;
}

#community-cta p {
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  margin-bottom: 30px;
}

.community-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ====== Contact Section ====== */
#contact {
  padding: 80px 20px;
  background: var(--secondary-color);
  text-align: center;
}

#contact h2 {
  font-size: 2.5rem;
  color: var(--brand-color);
  margin-bottom: 20px;
}

#contact p {
  font-size: 1.2rem;
  color: var(--secondary-text-color);
  margin-bottom: 15px;
}

.contact-info {
  margin-top: 30px;
}

.contact-info a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* ====== Footer ====== */
footer {
  background-color: var(--primary-color);
  color: var(--primary-text-color);
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

/* ====== Loading Screen ====== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.road {
  position: relative;
  width: 320px;
  height: 50px;
  background: #333;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.road::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    to right,
    #fff 0px,
    #fff 20px,
    transparent 20px,
    transparent 40px
  );
  transform: translateY(-50%);
  animation: roadMove 0.8s linear infinite;
}

@keyframes roadMove {
  from { background-position-x: 0; }
  to { background-position-x: -40px; }
}

.car {
  position: absolute;
  left: -60px;
  top: 5px;
  font-size: 2rem;
  animation: drive 2.5s linear infinite;
  will-change: left;
}

.car-inner {
  display: inline-block;
  transform: scaleX(-1);
  animation: bounce 0.6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes drive {
  0% { left: -60px; }
  100% { left: 320px; }
}

@keyframes bounce {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-3px); }
}

.loading-text {
  margin-top: 15px;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--brand-color);
  text-shadow: 0 0 10px rgba(44, 145, 192, 0.8);
  animation: pulseText 1.2s ease-in-out infinite;
}

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

/* ====== Animations ====== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

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

/* ====== Responsive Design ====== */
@media (max-width: 1024px) {
  .gamemode-card.featured {
    grid-column: span 1;
  }

  .minigames-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .gradient-text {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.125rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .server-info {
    flex-direction: column;
    gap: 15px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .counter {
    font-size: 2.5rem;
  }

  .gamemode-grid {
    grid-template-columns: 1fr;
  }

  #gamemodes h2,
  #updates h2,
  #community-cta h2,
  #contact h2 {
    font-size: 2rem;
  }

  .updates-grid {
    grid-template-columns: 1fr;
  }

  .community-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .gradient-text {
    font-size: 2rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 28px;
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .road {
    width: 250px;
  }
}