/**
 * GAWSTU.COM - Complete Design System V2
 * Modern Minecraft Nickname Database
 * Mobile-first, responsive, green glow aesthetic
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  /* Colors - Main Palette */
  --glow-green: #39d98a;
  --glow-green-bright: #4df0a0;
  --glow-green-dark: #2eb872;
  --glow-green-alpha-10: rgba(57, 217, 138, 0.1);
  --glow-green-alpha-20: rgba(57, 217, 138, 0.2);
  --glow-green-alpha-50: rgba(57, 217, 138, 0.5);

  /* Backgrounds */
  --bg-dark: #0a0a0a;
  --bg-darker: #050505;
  --bg-card: rgba(0, 0, 0, 0.6);
  --bg-card-hover: rgba(0, 0, 0, 0.8);
  --bg-input: rgba(20, 20, 20, 0.9);

  /* Borders */
  --border-color: rgba(57, 217, 138, 0.2);
  --border-hover: rgba(57, 217, 138, 0.5);
  --border-focus: rgba(57, 217, 138, 0.8);

  /* Status Colors */
  --status-known: #39d98a;
  --status-unknown: #666;
  --warning: #ffa500;
  --danger: #ff4d4d;
  --info: #4da3ff;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(57, 217, 138, 0.4);
  --shadow-glow-strong: 0 0 30px rgba(57, 217, 138, 0.6);

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Courier New", Consolas, Monaco, monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-modal: 1050;
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(57, 217, 138, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(57, 217, 138, 0.02) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--glow-green);
  text-shadow: 0 0 10px var(--glow-green-alpha-50);
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--glow-green);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
}

a:hover {
  color: var(--glow-green-bright);
  text-shadow: 0 0 8px var(--glow-green-alpha-50);
}

strong {
  font-weight: 700;
}
em {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--glow-green);
}

pre {
  background: var(--bg-input);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

pre code {
  background: none;
  padding: 0;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Flexbox Utilities */
.flex {
  display: flex;
  gap: var(--space-md);
}

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

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}
.flex-col {
  flex-direction: column;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-green);
  text-shadow: 0 0 15px var(--glow-green-alpha-50);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-base);
}

.site-logo:hover {
  text-shadow: 0 0 25px var(--glow-green-alpha-50);
  transform: scale(1.05);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  align-items: center;
}

.main-nav a {
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--glow-green);
  background: var(--glow-green-alpha-10);
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--glow-green);
  box-shadow: 0 0 8px var(--glow-green);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--glow-green);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  text-shadow: 0 0 30px var(--glow-green-alpha-50);
  animation: glow-pulse 3s ease-in-out infinite;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes glow-pulse {
  0%,
  100% {
    text-shadow: 0 0 20px var(--glow-green-alpha-50);
  }
  50% {
    text-shadow: 0 0 40px var(--glow-green-alpha-50),
      0 0 60px var(--glow-green-alpha-20);
  }
}

/* ========================================
   SEARCH BAR
   ======================================== */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 50px;
  font-size: 1.125rem;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  right: 0;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: var(--z-dropdown);
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--glow-green-alpha-10);
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--glow-green),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.card-title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--glow-green);
}

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

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Card Clickable */
.card-clickable {
  cursor: pointer;
}

/* Nickname Card Specific */
.nickname-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 250px; /* Ensures minimum consistent height */
}

.nickname-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-green);
  margin-bottom: var(--space-sm);
  word-break: break-word;
}

.nickname-meta {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.nickname-description {
  flex-grow: 1;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.nickname-footer {
  margin-top: auto;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-full);
  border: 1px solid;
}

.badge-known {
  background: var(--glow-green-alpha-10);
  color: var(--status-known);
  border-color: var(--status-known);
}

.badge-unknown {
  background: rgba(102, 102, 102, 0.1);
  color: var(--status-unknown);
  border-color: var(--status-unknown);
}

.badge-warning {
  background: rgba(255, 165, 0, 0.1);
  color: var(--warning);
  border-color: var(--warning);
}

.badge-danger {
  background: rgba(255, 77, 77, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.badge-info {
  background: rgba(77, 163, 255, 0.1);
  color: var(--info);
  border-color: var(--info);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
  font-family: var(--font-main);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button Variants */
.btn-primary {
  background: var(--glow-green);
  color: var(--bg-dark);
  border-color: var(--glow-green);
}

.btn-primary:hover {
  background: var(--glow-green-bright);
  border-color: var(--glow-green-bright);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--glow-green);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--glow-green-alpha-10);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-primary);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #e63939;
  border-color: #e63939;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--glow-green-alpha-10);
  color: var(--glow-green);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
  display: flex;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--glow-green-alpha-10);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-helper {
  display: block;
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: var(--space-sm);
}

/* Form Validation */
.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--danger);
}

.form-input.is-valid,
.form-textarea.is-valid {
  border-color: var(--status-known);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.form-check-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* ========================================
   STATS BANNER
   ======================================== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--glow-green);
  text-shadow: 0 0 15px var(--glow-green-alpha-50);
  display: block;
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========================================
   TABLES
   ======================================== */
.table-container {
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

thead {
  background: var(--bg-input);
}

th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--glow-green);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--glow-green-alpha-10);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.alert-success {
  background: var(--glow-green-alpha-10);
  color: var(--status-known);
  border-color: var(--status-known);
}

.alert-warning {
  background: rgba(255, 165, 0, 0.1);
  color: var(--warning);
  border-color: var(--warning);
}

.alert-danger {
  background: rgba(255, 77, 77, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.alert-info {
  background: rgba(77, 163, 255, 0.1);
  color: var(--info);
  border-color: var(--info);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.pagination-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  min-width: 40px;
  text-align: center;
}

.pagination-btn:hover {
  background: var(--glow-green-alpha-10);
  border-color: var(--border-hover);
  color: var(--glow-green);
}

.pagination-btn.active {
  background: var(--glow-green);
  border-color: var(--glow-green);
  color: var(--bg-dark);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}

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

.footer-section h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: var(--text-secondary);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}
.text-secondary {
  color: var(--text-secondary);
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: var(--space-sm);
}
.mt-2 {
  margin-top: var(--space-md);
}
.mt-3 {
  margin-top: var(--space-lg);
}
.mt-4 {
  margin-top: var(--space-xl);
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: var(--space-sm);
}
.mb-2 {
  margin-bottom: var(--space-md);
}
.mb-3 {
  margin-bottom: var(--space-lg);
}
.mb-4 {
  margin-bottom: var(--space-xl);
}

.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}

/* ========================================
/**
 * MOBILE RESPONSIVENESS FIXES FOR GAWSTU.COM
 * Add these rules to the end of styles.css (replace existing mobile section)
 */

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Base mobile styles (applied to all screens, then overridden for larger) */

/* Ensure container has proper mobile padding */
.container {
  padding: 0 var(--space-md);
}

/* Make all grids single column on mobile by default */
.grid-2,
.grid-3,
.grid-4,
.grid-auto {
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  html {
    font-size: 17px;
  }

  .container {
    padding: 0 var(--space-lg);
  }

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

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

  .grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }

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

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* Mobile specific overrides (max-width: 767px) */
@media (max-width: 767px) {
  /* === LOGOUT BUTTON FIX === */
  .main-nav form {
    width: 100%;
    margin: 0;
  }

  .main-nav .btn-ghost {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-md);
    justify-content: flex-start;
  }

  .main-nav .btn-ghost:hover {
    color: var(--glow-green);
    background: var(--glow-green-alpha-10);
  }

  /* === TYPOGRAPHY === */
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }
  h4 {
    font-size: 1.125rem;
  }
  h5 {
    font-size: 1rem;
  }

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

  .hero-subtitle {
    font-size: 1rem;
  }

  /* === HEADER & NAVIGATION === */
  .site-header {
    padding: var(--space-sm) 0;
  }

  .header-content {
    gap: var(--space-sm);
  }

  .site-logo {
    font-size: 1.25rem;
  }

  /* === HEADER FIXES === */
  .site-header {
    z-index: 1020 !important;
    background: rgba(0, 0, 0, 0.95);
  }

  .header-content {
    position: relative;
    z-index: 1021;
  }

  /* Mobile menu toggle button */
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--glow-green);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    -webkit-tap-highlight-color: transparent;
    z-index: 1022;
    position: relative;
  }

  /* Mobile navigation menu - HIDDEN BY DEFAULT */
  .main-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.98);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    z-index: 1019;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  }

  /* Show menu when active */
  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.99); /* More opaque when open */
  }

  /* Add overlay when menu is open */
  .main-nav.active::before {
    content: '';
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85); /* Darker overlay */
    z-index: -1;
    backdrop-filter: blur(8px); /* Stronger blur */
  }

  .main-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0;
    list-style: none;
  }

  .main-nav li {
    width: 100%;
    border-bottom: 1px solid rgba(57, 217, 138, 0.1);
  }

  .main-nav li:last-child {
    border-bottom: none;
  }

  .main-nav a {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    color: var(--text-secondary);
    transition: all 0.2s ease;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: var(--glow-green-alpha-10);
    color: var(--glow-green);
  }

  /* Fix for buttons inside nav (Sign Up, Logout) */
  .main-nav .btn {
    display: block;
    width: calc(100% - var(--space-lg) * 2);
    margin: var(--space-sm) var(--space-lg);
    text-align: center;
    justify-content: center;
    background: var(--glow-green);
    color: var(--bg-dark);
    border: none;
    padding: var(--space-md);
    font-weight: 600;
    min-height: 44px;
    pointer-events: auto;
    z-index: 1;
    position: relative;
  }

  .main-nav .btn:hover {
    background: var(--glow-green-bright);
    transform: none;
  }

  /* Logout button specific styling */
  .main-nav form {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .main-nav .btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
  }

  .main-nav .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Ensure content doesn't hide under sticky header */
  .site-main {
    position: relative;
    z-index: 1;
  }

  /* === LAYOUT === */
  .container {
    padding: 0 var(--space-md);
  }

  /* Force all grids to single column */
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto {
    grid-template-columns: 1fr !important;
    gap: var(--space-md);
  }

  /* Stats banner should show 2 columns on mobile - STRENGTHENED */
  .stats-banner .grid-4,
  .stats-banner .grid,
  .stats-banner > .container > .grid,
  .stats-banner .grid.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-sm) !important;
  }

  .stats-banner .stat-card,
  .stats-banner .grid .stat-card {
    padding: var(--space-md) !important;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* === SPACING === */
  .hero {
    padding: var(--space-xl) 0;
  }

  section {
    padding: var(--space-lg) 0;
  }

  /* === SEARCH === */
  .search-container {
    margin-bottom: var(--space-lg);
  }

  .search-input {
    font-size: 1rem;
    padding: var(--space-md);
    padding-left: 45px;
  }

  .search-icon {
    font-size: 1.125rem;
  }

  /* === CARDS === */
  .card {
    padding: var(--space-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .card-title {
    font-size: 1.125rem;
  }

  /* === BUTTONS === */
  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    /* Make buttons easier to tap */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
  }

  /* === FORMS === */
  .form-group {
    margin-bottom: var(--space-md);
  }

  .form-label {
    font-size: 0.875rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 1rem; /* Prevents iOS zoom on focus */
    padding: var(--space-md);
    /* Make inputs easier to tap */
    min-height: 44px;
  }

  .form-textarea {
    min-height: 120px;
  }

  /* === IMAGE UPLOAD === */
  .image-upload-box {
    padding: var(--space-md) !important;
    min-height: 150px;
  }

  .upload-icon {
    font-size: 2rem;
  }

  .upload-text {
    font-size: 0.875rem;
  }

  /* === PROFILE PAGE === */
  .profile-header {
    flex-direction: column !important;
    text-align: center;
    gap: var(--space-md);
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-info {
    align-items: center;
  }

  .profile-stats {
    justify-content: center;
    gap: var(--space-md);
  }

  .profile-actions {
    width: 100%;
    flex-direction: column;
  }

  .profile-actions .btn {
    width: 100%;
  }

  /* === NICKNAME/POST CARDS === */
  .nickname-card,
  .post-card {
    padding: var(--space-md);
  }

  .nickname-header,
  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .nickname-meta,
  .post-meta {
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: 0.75rem;
  }

  .nickname-actions,
  .post-actions {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  /* === COMMENTS === */
  .comment {
    padding: var(--space-md);
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .comment-body {
    font-size: 0.875rem;
  }

  .comment-actions {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  /* === BADGES === */
  .badge {
    font-size: 0.75rem;
    padding: 2px 8px;
  }

  /* === TABLES === */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  th,
  td {
    padding: var(--space-sm);
    font-size: 0.875rem;
  }

  /* === MODALS/DROPDOWNS === */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: var(--space-md);
  }

  .dropdown-menu {
    min-width: 200px;
  }

  /* === PAGINATION === */
  .pagination {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .pagination-btn {
    padding: var(--space-sm);
    min-width: 36px;
    font-size: 0.875rem;
  }

  /* === FOOTER === */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-section {
    text-align: center;
  }

  /* === UTILITY CLASSES === */
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  /* Stack flex items on mobile */
  .flex-mobile-col {
    flex-direction: column;
  }

  /* === TOUCH IMPROVEMENTS === */

  /* Remove hover effects on touch devices */
  @media (hover: none) {
    .card:hover,
    .nickname-card:hover,
    .post-card:hover {
      transform: none;
    }
  }

  /* Improve tap targets */
  a,
  button,
  .btn,
  input[type="checkbox"],
  input[type="radio"] {
    -webkit-tap-highlight-color: rgba(57, 217, 138, 0.2);
  }

  /* Prevent text selection on buttons */
  .btn,
  button {
    -webkit-user-select: none;
    user-select: none;
  }

  /* === DASHBOARD & MODERATION === */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .moderation-filters {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .moderation-filters .btn {
    width: 100%;
  }

  .moderation-item {
    padding: var(--space-md);
  }

  .moderation-actions {
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .moderation-actions .btn {
    width: 100%;
  }

  /* === VOTE BUTTONS === */
  .vote-buttons {
    flex-direction: row;
    gap: var(--space-xs);
  }

  .vote-btn {
    min-width: 60px;
    padding: var(--space-sm);
  }

  /* === IMAGE PREVIEW === */
  .image-preview {
    max-width: 100%;
    height: auto;
  }

  .uploaded-image {
    max-width: 100%;
    border-radius: var(--radius-md);
  }
}

/* Extra small phones (max-width: 375px) */
@media (max-width: 375px) {
  html {
    font-size: 13px;
  }

  .container {
    padding: 0 var(--space-sm);
  }

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

  .stat-number {
    font-size: 1.5rem;
  }

  .btn {
    font-size: 0.8125rem;
    padding: var(--space-xs) var(--space-sm);
  }

  /* Make stats banner single column on very small screens */
  .stats-banner {
    grid-template-columns: 1fr !important;
  }
}

/* Landscape orientation fixes */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    padding: var(--space-lg) 0;
  }

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

  .main-nav {
    max-height: calc(100vh - 50px);
  }
}
