/* SarzaminGames.ir - Main Stylesheet */
:root {
  --sg-bg: #f8fafc;
  --sg-surface: #ffffff;
  --sg-dark: #0f172a;
  --sg-dark-2: #1e293b;
  --sg-primary: #6366f1;
  --sg-primary-hover: #4f46e5;
  --sg-accent: #06b6d4;
  --sg-text: #1e293b;
  --sg-muted: #64748b;
  --sg-border: #e2e8f0;
  --sg-radius: 14px;
  --sg-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --sg-shadow-hover: 0 12px 30px rgba(99, 102, 241, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background-color: var(--sg-bg);
  color: var(--sg-text);
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.sg-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.sg-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
}

.sg-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  max-width: 1240px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.sg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.sg-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sg-primary), var(--sg-accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sg-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sg-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: background 0.2s, color 0.2s;
}

.sg-nav a:hover,
.sg-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sg-search-form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px 6px;
}

.sg-search-form input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 190px;
}

.sg-search-form input::placeholder {
  color: #94a3b8;
}

.sg-search-form button {
  background: var(--sg-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.sg-search-form button:hover {
  background: var(--sg-primary-hover);
}

/* Main */
.site-main {
  flex: 1;
  padding: 28px 0 48px;
}

/* Hero */
.sg-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #0e7490 100%);
  color: #fff;
  border-radius: 20px;
  padding: 42px 32px;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: 0 15px 35px rgba(30, 27, 75, 0.2);
}

.sg-hero-content {
  max-width: 650px;
}

.sg-hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
}

.sg-hero p {
  margin: 0 0 22px;
  color: #e2e8f0;
  font-size: 1.05rem;
}

.sg-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
}

.sg-btn-primary {
  background: linear-gradient(135deg, var(--sg-primary), var(--sg-accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.sg-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.45);
}

.sg-btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.sg-btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sg-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.sg-stat-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 16px 22px;
  text-align: center;
  min-width: 120px;
}

.sg-stat-num {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  color: #38bdf8;
}

.sg-stat-label {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Section Headers */
.sg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.sg-section-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--sg-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sg-section-link {
  color: var(--sg-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.sg-section-link:hover {
  text-decoration: underline;
}

/* Category Grid */
.sg-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 44px;
}

.sg-cat-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius);
  padding: 24px;
  box-shadow: var(--sg-shadow);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sg-shadow-hover);
  border-color: var(--sg-primary);
}

.sg-cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.sg-cat-card h2,
.sg-cat-card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sg-dark);
}

.sg-cat-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sg-muted);
  flex: 1;
}

.sg-cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--sg-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sg-primary);
}

/* Games Grid */
.sg-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.sg-game-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius);
  overflow: hidden;
  box-shadow: var(--sg-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.sg-game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sg-shadow-hover);
  border-color: var(--sg-primary);
}

.sg-game-thumb {
  height: 130px;
  background: linear-gradient(135deg, #312e81, #0891b2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.6rem;
  position: relative;
}

.sg-game-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.sg-game-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sg-game-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sg-dark);
}

.sg-game-en {
  font-size: 0.8rem;
  color: var(--sg-muted);
  direction: ltr;
  text-align: right;
}

.sg-game-desc {
  margin: 0;
  font-size: 0.87rem;
  color: var(--sg-muted);
  flex: 1;
}

.sg-play-btn {
  margin-top: 8px;
  display: block;
  text-align: center;
  background: var(--sg-primary);
  color: #fff;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.sg-play-btn:hover {
  background: var(--sg-primary-hover);
}

/* Breadcrumb */
.sg-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--sg-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sg-breadcrumb a {
  color: var(--sg-primary);
}

/* Category Pills */
.sg-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.sg-pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sg-text);
  transition: all 0.2s;
}

.sg-pill:hover,
.sg-pill.active {
  background: var(--sg-primary);
  color: #fff;
  border-color: var(--sg-primary);
}

/* Footer */
.sg-footer {
  background: var(--sg-dark);
  color: #cbd5e1;
  padding: 40px 0 22px;
  margin-top: auto;
}

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

.sg-footer h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.sg-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.sg-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg-footer ul a {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.sg-footer ul a:hover {
  color: #fff;
}

.sg-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* Blog compatibility tweaks */
.btn.btn-primary {
  display: inline-block;
  background: var(--sg-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
}

.btn.btn-primary:hover {
  background: var(--sg-primary-hover);
}

@media (max-width: 768px) {
  .sg-hero {
    padding: 28px 20px;
  }
  .sg-hero h1 {
    font-size: 1.5rem;
  }
  .sg-search-form {
    width: 100%;
  }
  .sg-search-form input {
    flex: 1;
    width: auto;
  }
}
