/* Common CSS for all pages - Optimized from index.html, games.html, action.html, and view_all.html */

/* ===== CSS Variables for Theming ===== */
:root {
  --primary-color: #8a2be2;
  --primary-light: #b388ff;
  --primary-dark: #6a1b9a;
  --secondary-color: #fdbb2d;
  --secondary-light: #ffe082;
  --accent-color: #ff6b6b;
  --text-color: #2d3436;
  --light-text: #636e72;
  --bg-gradient: linear-gradient(135deg, #cea7ff 0%, #d5bef0 100%);
  --card-bg: #ffffff;
  --card-bg-alt: #f8f9fa;
  --header-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 15px rgba(0, 0, 0, 0.1);
  --border-radius-sm: 12px;
  --border-radius-md: 16px;
  --border-radius-lg: 20px;
  --btn-green: linear-gradient(45deg, #388e3c, #81c784);
  --btn-red: linear-gradient(45deg, #c62828, #ef5350);
}

/* ===== Base Styles ===== */
body {
  background: #ffffff !important;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

@media (min-width: 769px) {
  body {
    background: var(--bg-gradient) !important;
  }
}

/* ===== Navigation Styles ===== */
.navbar {
  background: var(--header-bg) !important;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1rem !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.02);
}

/* Logo Text Styling */
.logo-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-decoration: none;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  text-transform: uppercase;
  background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.logo-text:hover {
  transform: scale(1.05);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.logo-text span {
  color: var(--secondary-color);
  background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}

/* ===== Card Styles ===== */
.card {
  background: var(--card-bg) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
}

/* Subtle background pattern for cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.card-harder {
  background: linear-gradient(to right, rgba(157, 78, 221, 0.05), rgba(253, 187, 45, 0.05)) !important;
  color: var(--text-color) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0 !important;
  position: relative;
  z-index: 1;
  padding: 1rem 1.5rem !important;
}

.title {
  color: var(--primary-dark) !important;
  font-weight: 700 !important;
  position: relative;
  z-index: 1;
}

/* ===== Game Card Styles ===== */
.game-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Subtle pattern overlay for texture without performance impact */
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(138, 43, 226, 0.1);
}

.game-title {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 16px;
  text-align: center;
  padding: 15px 10px 5px;
  margin: 0;
  position: relative;
  z-index: 1;
}

.game-thumbnail {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: var(--border-radius-sm);
  margin: 0 auto;
  max-width: 90%;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.game-card:hover .game-thumbnail {
  transform: scale(1.03);
}

.game-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--text-color);
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.game-reward strong {
  color: var(--primary-color);
  font-weight: 700;
}

.coin-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.start-button {
  background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 25px;
  padding: 8px 0;
  width: 80%;
  margin: 8px auto;
  display: block;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 3px 6px rgba(253, 187, 45, 0.2);
}

/* Subtle shine effect on buttons */
.start-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to bottom right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: rotate(30deg);
  transition: transform 0.5s ease;
  z-index: 0;
}

.start-button:hover::after {
  transform: rotate(30deg) translate(10%, 10%);
}

.start-button:hover {
  background: linear-gradient(to right, var(--secondary-light), var(--secondary-color));
  box-shadow: 0 4px 10px rgba(253, 187, 45, 0.3);
  transform: translateY(-2px);
}

.user-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  color: var(--light-text);
  margin-top: 5px;
  position: relative;
  z-index: 1;
}

.user-dot {
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
  position: relative;
}

.user-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
  opacity: 0.7;
  transform: scale(1.5);
  z-index: -1;
}

/* ===== Category Icon Styling ===== */
.category-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* ===== Page Header Styling ===== */
.page-header {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.page-header h1::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));
  border-radius: 2px;
}

/* ===== Container Styling ===== */
.back {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Utility Classes ===== */
.boxTextCenter {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.boxCenter {
  display: flex !important;
  justify-content: center !important;
}

/* ===== Ad Box Styling ===== */
.ads-box {
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* ===== Responsive Styles ===== */
@media (max-width: 767px) {
  .back {
    padding: 0.5rem !important;
  }

  .card-body {
    padding: 0.5rem 1rem !important;
  }

  .game-title {
    font-size: 14px;
    padding: 10px 5px 5px;
  }

  .game-thumbnail {
    height: 100px;
    border-radius: 10px;
  }

  .game-reward {
    font-size: 12px;
    margin: 5px 0;
  }

  .start-button {
    font-size: 12px;
    padding: 6px 0;
    width: 85%;
  }

  .user-count {
    font-size: 10px;
  }

  .card {
    margin-bottom: 1rem !important;
    border-radius: 12px !important;
  }

  .ads-box {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.5rem 0;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 575px) {
  .col-6 {
    padding-left: 5px;
    padding-right: 5px;
  }

  .row {
    margin-left: -5px;
    margin-right: -5px;
  }

  .my-3 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .card-harder {
    padding: 0.75rem 1rem !important;
  }

  .title {
    font-size: 16px !important;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 359px) {
  .game-title {
    font-size: 12px;
  }

  .game-thumbnail {
    height: 80px;
  }

  .start-button {
    width: 90%;
    font-size: 10px;
    padding: 5px 0;
  }

  .category-icon {
    width: 18px;
    height: 18px;
  }
}

/* ===== Touch Device Fixes ===== */
@media (hover: none) {
  .start-button:hover {
    background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));
    transform: none;
  }

  .start-button:active {
    background: linear-gradient(to right, var(--secondary-light), var(--secondary-color));
    transform: translateY(-2px);
  }

  .game-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .game-card:active {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .game-card:hover .game-thumbnail {
    transform: none;
  }

  .game-card:active .game-thumbnail {
    transform: scale(1.02);
  }
}