/* style.css - Main Global Styles */

/* Primary Theme Variables (from the first :root block in your combined file) */
:root {
  --primary: #6C63FF; /* Purple-ish blue */
  --primary-dark: #5a52e0;
  --secondary: #fbb03b; /* Orange */
  --secondary-dark: #e69a2b;
  --accent: #4CAF50; /* Green */
  --dark: #1a1a2e; /* Dark Blue/Black */
  --light: #f8f9fa;
  --gray: #6c757d;
  --gradient: linear-gradient(135deg, var(--primary) 0%, #8e6bff 100%);
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

/* Universal Box Sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Mobile Performance & Safety */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Prevent mobile rendering issues */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Body Base Styles */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #ffffff;
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container for Centering Content */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header (Top Navigation Bar) */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.logo i {
  color: var(--secondary);
}

.logo:hover {
  transform: translateY(-2px);
}

/* Navigation Menu */
nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 16px;
  transition: var(--transition);
  position: relative;
  padding: 5px 0;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

nav a:hover {
  color: var(--primary);
}

nav a:hover::after {
  width: 100%;
}

/* Call-to-Action Button */
.cta-button {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
  text-decoration: none;
  display: inline-block;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* Hero Section Styles */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.05) 0%, rgba(251, 176, 59, 0.05) 100%);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 50px;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}

.hero-title span {
    color: var(--primary);
}

/* General Section Header */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--dark);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--gray);
  font-size: 1.1rem;
}

/* Features Grid (Used in Hero section) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

/* Feature Card Styles */
.feature-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  z-index: 1;
  cursor: pointer;
}

/* New "New" badge style */
.feature-card .new-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--secondary);
    color: white;
    padding: 5px 15px;
    font-size: 0.8rem;
    font-weight: bold;
    border-bottom-left-radius: 10px;
    z-index: 10;
    transform: translate(0px, 0px);
    box-shadow: 0 4px 15px rgba(251, 176, 59, 0.3);
    animation: superBounce 1.5s infinite cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hot badge style */
.feature-card .new-badge.hot {
    background-color: #dc3545; /* Red background for HOT badge */
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-card:hover::before {
  opacity: 0.1;
}

.feature-icon {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--primary);
  background: rgba(108, 99, 255, 0.05);
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--primary-dark);
}

.feature-content {
  padding: 20px 15px;
}

.feature-content h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--dark);
  line-height: 1.2;
}

.feature-content p {
  color: var(--gray);
  margin-bottom: 15px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.feature-link i {
  margin-left: 8px;
  transition: var(--transition);
}

.feature-link:hover {
  color: var(--primary-dark);
}

.feature-link:hover i {
  transform: translateX(4px);
}

/* Multiplayer Card Special Styling */
.multiplayer-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  position: relative;
  overflow: hidden;
}

.multiplayer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
  opacity: 0;
  transition: var(--transition);
  z-index: 1;
}

.multiplayer-card:hover::before {
  opacity: 1;
}

.multiplayer-card .feature-icon {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.multiplayer-card:hover .feature-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.multiplayer-card .feature-content h3 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.multiplayer-card .feature-content p {
  color: rgba(255, 255, 255, 0.9);
}

.multiplayer-card .feature-link {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 8px 16px;
  transition: var(--transition);
}

.multiplayer-card .feature-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animated glow effect for multiplayer card */
.multiplayer-card {
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  animation: subtle-glow 3s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
  from {
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  }
  to {
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
  }
}

/* Stats Section */
.stats {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary) 0%, #8e6bff 100%);
  color: white;
  text-align: center;
}

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

.stat-item {
  padding: 30px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Testimonials Section */
.testimonials {
  padding: 100px 0;
  background: #f9f9ff;
}

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

.testimonial-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 5rem;
  color: rgba(108, 99, 255, 0.1);
  font-family: serif;
  line-height: 1;
}

.testimonial-text {
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient);
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.author-info h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.author-info p {
  font-size: 0.9rem;
  color: var(--gray);
}

/* Footer Styles */
footer {
  background: var(--dark);
  color: white;
  padding: 60px 0 30px;
}

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

.footer-col h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.footer-col p {
  margin-bottom: 20px;
  opacity: 0.8;
}

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

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

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

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

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes superBounce {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(5deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.15) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Media Queries (Responsive Design) */
@media (min-width: 1000px) {
  .features-grid {
    grid-template-columns: repeat(6, 1fr); /* 6 cards in one row on large screens */
    gap: 15px;
  }
}

@media (min-width: 769px) and (max-width: 999px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 cards per row on medium screens */
    gap: 20px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    min-height: 100px; /* Ensure header has enough height */
  }
  .logo {
    font-size: 24px;
  }
  nav {
    display: block; /* Show navigation on mobile */
    width: 100%;
  }
  nav ul {
    gap: 15px; /* Smaller gap between nav items on mobile */
    justify-content: center; /* Center the nav buttons */
    flex-wrap: wrap; /* Allow wrapping if needed */
  }
  nav a {
    font-size: 14px; /* Slightly smaller font on mobile */
    padding: 10px 20px; /* More balanced padding */
    background: var(--primary);
    color: white;
    border-radius: 25px;
    text-align: center;
    min-width: 80px; /* Ensure minimum width for symmetry */
    flex: 1; /* Equal width buttons */
    max-width: 120px; /* Prevent buttons from getting too wide */
  }
  nav a:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .features-grid {
    grid-template-columns: 1fr; /* Stack cards on small screens */
  }
  /* Adjust sections to account for larger header */
  .leaderboard-section {
    margin-top: 20px; /* Less margin since body has padding now */
  }
}


/* Diamond Count Display (Top Left) */
#diamond-count-container {
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    z-index: 9999; /* Ensure it's on top */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ddd;
    transition: all 0.3s ease; /* Smooth transition for theme changes */
    backdrop-filter: blur(10px);
}

#diamond-count-container i.fas.fa-gem {
    color: #007bff; /* Blue for diamond icon */
    font-size: 1em; /* Same size as text */
    text-shadow: none; /* Remove glow effect for cleaner look */
}

/* Diamond Pop-up (Middle of Screen) */
.diamond-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000; /* Ensure it's above everything else */
    pointer-events: none; /* Allow clicks to pass through */
}

.diamond-popup-container.show {
    opacity: 1;
    visibility: visible;
}

.diamond-icon {
    font-size: 8em; /* Large diamond */
    line-height: 1;
    color: #007bff; /* Blue diamond color */
    text-shadow: 0 0 10px #007bff, 0 0 20px #007bff, 0 0 30px #007bff, 0 0 40px #007bff; /* Blue glowing effect */
    animation: pop-and-fade 1.2s forwards; /* Animation for the diamond itself */
    position: relative;
    transform: scale(0.5); /* Start small */
    opacity: 0; /* Start invisible */
}

/* Animation for the diamond pop-up */
@keyframes pop-and-fade {
    0% { transform: scale(0.5) translateY(50px); opacity: 0; filter: brightness(0.5); }
    20% { transform: scale(1.2) translateY(-20px); opacity: 1; filter: brightness(1.5); }
    50% { transform: scale(1) translateY(0); opacity: 1; filter: brightness(1); }
    80% { opacity: 0.8; transform: scale(0.9) translateY(-10px); }
    100% { transform: scale(0.8) translateY(-50px); opacity: 0; filter: brightness(0); } /* Hover up and fade out */
}

.plus-one-text {
    font-size: 2.5em;
    font-weight: 700;
    color: gold; /* Gold color for the text */
    text-shadow: 0 0 5px gold, 0 0 10px gold; /* Glowing effect for text */
    margin-top: 10px;
    animation: fade-up 1.2s forwards; /* Animation for the text */
    opacity: 0; /* Start invisible */
    transform: translateY(20px); /* Start below */
}

/* Animation for the "+X" text */
@keyframes fade-up {
    0% { opacity: 0; transform: translateY(20px); }
    50% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); } /* Move up and fade out */
}

/* Responsive adjustments for diamond display and popup */
@media (max-width: 768px) {
    #diamond-count-container {
        top: 10px;
        left: 10px;
        padding: 6px 8px;
        font-size: 0.9em;
    }
    #diamond-count-container i.fas.fa-gem {
        font-size: 1em; /* Same size as text on mobile */
    }
    .diamond-icon {
        font-size: 6em; /* Smaller diamond on small screens */
        color: #007bff; /* Blue color for popup diamond */
        text-shadow: 0 0 10px #007bff, 0 0 20px #007bff;
    }
    .plus-one-text {
        font-size: 2em; /* Smaller text on small screens */
    }
}

@media (max-width: 480px) {
    #diamond-count-container {
        top: 8px;
        left: 8px;
        padding: 5px 8px;
        font-size: 0.85em;
    }
    #diamond-count-container i.fas.fa-gem {
        font-size: 1em; /* Same size as text on very small screens */
    }
    .diamond-icon {
        font-size: 5em; /* Even smaller diamond on very small screens */
        color: #007bff; /* Blue color for popup diamond */
        text-shadow: 0 0 8px #007bff, 0 0 15px #007bff;
    }
    .plus-one-text {
        font-size: 1.8em; /* Smaller text on very small screens */
    }
}