/* Eggy Car - Main Stylesheet */

:root {
  /* Main color scheme */
  --primary-color: #3498db;
  --primary-color-rgb: 52, 152, 219;
  --secondary-color: #2ecc71;
  --accent-color: #9b59b6;
  --background-color: #ffffff;
  --text-color: #333333;
  --header-color: #222222;
  --footer-bg: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;

  /* Optimized shadow system */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 15px 30px rgba(0, 0, 0, 0.3);

  /* Font settings */
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: 'Arial', sans-serif;

  /* Optimized font size system */
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;

  /* Responsive font sizes */
  --font-responsive-h1-tablet: 1.9rem;
  --font-responsive-h2-tablet: 1.6rem;
  --font-responsive-h3-tablet: 1.3rem;
  --font-responsive-p-tablet: 0.95rem;
  --font-responsive-h1-mobile: 1.7rem;
  --font-responsive-h2-mobile: 1.4rem;
  --font-responsive-h3-mobile: 1.2rem;
  --font-responsive-p-mobile: 0.9rem;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Optimized transition system */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Site-wide gradient background */
  --gradient-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);

  /* Reviews section variables */
  --card-bg-color: rgba(255, 255, 255, 0.15);
  --card-border-color: rgba(255, 255, 255, 0.2);
  --review-animation-duration: 30s;

  /* Performance optimization variables */
  --gpu-acceleration: translate3d(0, 0, 0);
  --will-change-transform: transform;
  --will-change-auto: auto;
  --backface-hidden: hidden;
  --perspective-1000: 1000px;
  --contain-layout: layout;
  --transform-gpu: translate3d(0, 0, 0);
}

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

body {
  font-family: var(--font-main);
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: white;
  line-height: 1.6;
  padding-top: 80px; /* Add padding to account for fixed header */
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: white;
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

a {
  color: white;
  text-decoration: none;
  transition: color var(--transition-base);
  font-weight: 500;
}

a:hover {
  color: var(--secondary-color);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

img {
  max-width: 100%;
  height: auto;
  transition: opacity var(--transition-base);
  transform: var(--gpu-acceleration); /* Hardware acceleration */
}

/* Lazy loading image styles */
img[data-src] {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

/* Container */
.container {
  width: 100%;
  max-width: 1000px; /* Reduced default container width for tighter content */
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Hero section */
.hero {
  padding: calc(var(--spacing-xl) * 1.5) 0; /* Reduced top and bottom padding */
  color: white;
  margin-top: 0; /* Removed margin-top since we have padding-top on body */
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg); /* Reduced spacing */
  min-height: 50vh; /* Reduced minimum height */
}

.hero-content {
  flex: 1;
  text-align: left;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-element-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.floating-element {
  position: absolute;
  width: 96%; /* Base image 80% * 1.2 = 96%, scaled 20% larger than base image */
  height: auto;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Perfect centering */
  animation: float 4s ease-in-out infinite; /* Add floating animation */
  pointer-events: none; /* Ensure mouse events pass through to base image */
}

@keyframes float {
  0% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 15px));
  }
  100% {
    transform: translate(-50%, -50%);
  }
}

.hero-img {
  max-width: 80%; /* Base image reduced by 20% */
  border-radius: 30%; /* Use percentage value for rounded corners, similar to reference design */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  /* Removed hover animation effects */
  margin: 0 auto; /* Center display */
  display: block; /* Ensure margin: 0 auto takes effect */
}

.hero h1 {
  font-size: 2.2rem; /* Reduced title font size */
  margin-bottom: var(--spacing-md);
  color: white;
}

.hero-description {
  font-size: 1rem; /* Reduced description text font size */
  margin-bottom: var(--spacing-md); /* Reduced bottom spacing */
  line-height: 1.6; /* Reduced line height */
}

/* Optimized game button styles */
.game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary-color);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--secondary-color);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  z-index: 1;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: var(--font-base);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-sizing: border-box;
  transform: var(--gpu-acceleration); /* Hardware acceleration */
  will-change: var(--will-change-transform);
}

.game-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: skewX(-25deg);
  transition: all 0.75s;
  z-index: -1; /* Ensure shine effect is below text */
}

.game-button:hover {
  transform: translateY(-3px); /* Button moves up on hover */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Add shadow effect for enhanced 3D appearance */
  color: white; /* Ensure text color remains unchanged on hover */
}

.game-button:hover::before {
  left: 125%;
}

/* Small size button */
.game-button.small {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.9rem;
}

/* Button container styles */
.center-button-container {
  text-align: center !important;
  margin-top: var(--spacing-lg);
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Optimized button styles - reduce !important usage */
.game-button.full-width-mobile,
.game-button.small.full-width-mobile {
  width: auto;
  max-width: 90%;
  min-width: 280px;
  background-color: var(--secondary-color);
  color: white;
  border: 2px solid var(--secondary-color);
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-weight: 600;
  min-height: 48px;
  line-height: 1.2;
  margin: 0 auto;
}

/* Ensure button elements have the same styles as links */
button.game-button {
  font-family: var(--font-main) !important;
  font-size: 1rem !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: 600 !important;
  background-color: var(--secondary-color) !important;
  color: white !important;
  border: 2px solid var(--secondary-color) !important;
  border-radius: 30px !important;
  text-align: center !important;
  cursor: pointer !important;
  text-decoration: none !important;
  outline: none !important;
}

button.game-button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3) !important;
}

button.game-button.small {
  font-size: 0.9rem !important;
}

/* Features section */
.features {
  padding: var(--spacing-lg) 0; /* Reduced padding */
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg); /* Reduced bottom spacing */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Reduced minimum width */
  gap: var(--spacing-md); /* Reduced spacing */
}

.feature-card {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: var(--spacing-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  text-align: center; /* Center content */
  height: 250px; /* Reduced fixed height */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.feature-card i {
  display: block;
  margin: 0 auto var(--spacing-md) auto; /* Center icon and add bottom spacing */
}

.feature-card h3 {
  margin-bottom: var(--spacing-sm);
}

/* Blog section */
.blog-posts {
  padding: var(--spacing-lg) 0; /* Reduced padding */
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Reduced minimum width */
  gap: var(--spacing-md); /* Reduced spacing */
  align-items: stretch; /* Ensure all cards have same height */
}

.blog-card {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  height: 100%;
  /* Remove max-height limit to ensure content is fully displayed */
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.blog-image {
  height: 180px; /* Reduced image height to leave more space for content */
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

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

.blog-content {
  padding: var(--spacing-sm); /* Reduced padding */
  display: flex;
  flex-direction: column;
  height: calc(100% - 180px); /* Subtract image height */
  overflow: visible; /* Ensure content is visible when overflowing */
}

.blog-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem; /* Reduced font size */
  margin-bottom: var(--spacing-xs);
}

.blog-card h3 {
  margin-bottom: var(--spacing-xs); /* Reduced bottom spacing */
  font-size: 1.1rem; /* Reduced title font size */
  line-height: 1.3; /* Reduced line height for tighter title */
}

.read-more {
  display: inline-block;
  margin-top: var(--spacing-sm);
  font-weight: 500;
}

/* PC Optimizations for blog cards */
@media (min-width: 1400px) {
  .blog-grid {
    gap: 1.5rem; /* Reduced spacing */
  }

  .blog-image {
    height: 180px; /* Reduced image height */
  }

  .blog-content {
    padding: 1rem; /* Reduced padding */
    height: calc(100% - 180px);
  }

  .blog-card h3 {
    font-size: 1.2rem; /* Reduced title font size */
  }
}