/* Responsive Design & Dark Mode Verbesserungen für Tychara */

/* ===== RESPONSIVE BREAKPOINTS ===== */
:root {
  --mobile: 480px;
  --tablet: 768px;
  --desktop: 1024px;
  --large: 1200px;
}

/* ===== MOBILE FIRST APPROACH ===== */
.game-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0;
  padding: 0 0.5rem;
}

.section-card {
  padding: 1.5rem;
  margin: 0 0.5rem;
}

.section-icon {
  font-size: 2.5rem;
}

.section-card h3 {
  font-size: 1.3rem;
}

.game-info {
  padding: 1.5rem;
  margin: 2rem 0.5rem;
}

.game-info h2 {
  font-size: 1.5rem;
}

/* ===== TABLET (768px+) ===== */
@media (min-width: 768px) {
  .game-sections {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2.5rem 0;
    padding: 0 1rem;
  }

  .section-card {
    padding: 2rem;
    margin: 0;
  }

  .section-icon {
    font-size: 3rem;
  }

  .section-card h3 {
    font-size: 1.5rem;
  }

  .game-info {
    padding: 2rem;
    margin: 2.5rem 0;
  }

  .game-info h2 {
    font-size: 2rem;
  }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
  .game-sections {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0;
    padding: 0 1rem;
  }

  .section-card {
    padding: 2.5rem;
  }

  .game-info {
    padding: 2.5rem;
    margin: 3rem 0;
  }
}

/* ===== LARGE DESKTOP (1200px+) ===== */
@media (min-width: 1200px) {
  .game-sections {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin: 3rem auto;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #8a8a8a;
    --border-color: #2d3748;
    --accent-color: #4299e1;
    --accent-hover: #3182ce;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
  }

  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
  }

  .section-card {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(45, 55, 72, 0.6);
    backdrop-filter: blur(15px);
  }

  .section-card:hover {
    background: rgba(26, 26, 46, 0.9);
    border-color: rgba(66, 153, 225, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .game-info {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(45, 55, 72, 0.6);
  }

  .section-card h3 {
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  }

  .section-card p {
    color: var(--text-secondary);
  }

  .game-info h2 {
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  }

  .game-info p {
    color: var(--text-secondary);
  }
}

/* ===== LIGHT MODE (Standard) ===== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --accent-color: #3182ce;
    --accent-hover: #2c5aa0;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --error-color: #e53e3e;
  }

  .section-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(226, 232, 240, 0.8);
    color: var(--text-primary);
  }

  .section-card:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .game-info {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(226, 232, 240, 0.8);
    color: var(--text-primary);
  }

  .section-card h3 {
    color: var(--text-primary);
    text-shadow: none;
  }

  .section-card p {
    color: var(--text-secondary);
  }

  .game-info h2 {
    color: var(--text-primary);
    text-shadow: none;
  }

  .game-info p {
    color: var(--text-secondary);
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  .section-card {
    animation: none;
    transition: none;
  }

  .section-card::before {
    display: none;
  }

  .section-card:hover {
    transform: none;
  }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .section-card {
    border-width: 2px;
    border-color: var(--text-primary);
  }

  .section-card:hover {
    border-color: var(--accent-color);
    border-width: 3px;
  }

  .game-info {
    border-width: 2px;
    border-color: var(--text-primary);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .section-card {
    background: white !important;
    color: black !important;
    border: 1px solid black !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .game-info {
    background: white !important;
    color: black !important;
    border: 1px solid black !important;
  }

  .section-icon {
    display: none;
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  .section-card {
    min-height: 120px;
  }

  .section-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .section-card:hover {
    transform: none;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .game-sections {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .section-card {
    padding: 1rem;
  }

  .section-icon {
    font-size: 2rem;
  }
}

/* ===== ULTRA-WIDE SCREENS ===== */
@media (min-width: 1600px) {
  .game-sections {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1600px;
  }

  .section-card {
    padding: 3rem;
  }

  .section-icon {
    font-size: 3.5rem;
  }
}

/* ===== FOCUS VISIBILITY ===== */
.section-card:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.section-card.loading {
  position: relative;
  overflow: hidden;
}

.section-card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(66, 153, 225, 0.2),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== ERROR STATES ===== */
.section-card.error {
  border-color: var(--error-color);
  background: rgba(245, 101, 101, 0.1);
}

.section-card.error::before {
  content: '⚠️';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
}

/* ===== SUCCESS STATES ===== */
.section-card.success {
  border-color: var(--success-color);
  background: rgba(72, 187, 120, 0.1);
}

.section-card.success::before {
  content: '✅';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
}
