/* ═══════════════════════════════════════════════════════════════════════════
   BINGO APP - GLOBAL STYLES
   Mobile-first, dark theme, responsive design
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;
  --border: #2a2a3d;
  --accent: #6c63ff;
  --accent-hover: #8075ff;
  --accent-glow: #6c63ff33;
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-dim: #555577;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ─────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────── */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #ff6775;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #3dd984;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.125rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ─────────────────────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ─────────────────────────────────────────────────────────────
   Utility Classes
   ───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  align-items: center;
  justify-content: space-between;
}

.gap-1 {
  gap: 4px;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}

.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-dim {
  color: var(--text-dim);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}

.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}

.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.hidden {
  display: none !important;
}

.opacity-50 {
  opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────
   Modals
   ───────────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  flex: 1;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ─────────────────────────────────────────────────────────────
   Toast Notifications
   ───────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.danger {
  border-left-color: var(--danger);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────────────────
   Badge & Status Indicators
   ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
}

.badge-success {
  background: rgba(46, 213, 115, 0.2);
  color: var(--success);
}

.badge-danger {
  background: rgba(255, 71, 87, 0.2);
  color: var(--danger);
}

.online-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.online-indicator.offline {
  background: var(--text-dim);
}

/* ─────────────────────────────────────────────────────────────
   Loading & Spinner
   ───────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────────────────────────
   Header/Navigation
   ───────────────────────────────────────────────────────────── */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────────────
   Page Layout
   ───────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────
   Tabs
   ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─────────────────────────────────────────────────────────────
   Responsive Design
   ───────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  html,
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .container {
    padding: 0 24px;
  }

  .modal-content {
    width: auto;
  }

  .toast-container {
    bottom: 16px;
    top: auto;
  }
}

/* ─────────────────────────────────────────────────────────────
   Bingo Board Styles
   ───────────────────────────────────────────────────────────── */
.board {
  display: grid;
  gap: 4px;
  aspect-ratio: 1;
  width: 100%;
  margin: 16px 0;
}

.board.size-3x3 {
  grid-template-columns: repeat(3, 1fr);
}
.board.size-4x4 {
  grid-template-columns: repeat(4, 1fr);
}
.board.size-5x5 {
  grid-template-columns: repeat(5, 1fr);
}
.board.size-6x6 {
  grid-template-columns: repeat(6, 1fr);
}
.board.size-7x7 {
  grid-template-columns: repeat(7, 1fr);
}

.cell {
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  min-height: 52px;
  transition: var(--transition);
  overflow: hidden;
}

.cell:hover {
  border-color: var(--accent);
  background: var(--border);
}

.cell.marked {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: white;
}

.cell-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.cell-free-space {
  font-size: 1.5rem;
}

.cell-overlays {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  gap: 1px;
}

.cell-overlay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.8;
}

.cell-bingo-line {
  box-shadow: inset 0 0 10px currentColor;
}

/* ─────────────────────────────────────────────────────────────
   Confetti Animation
   ───────────────────────────────────────────────────────────── */
@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotateZ(360deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  pointer-events: none;
  animation: confetti-fall 2s ease-out forwards;
}

/* ─────────────────────────────────────────────────────────────
   DEPLOYMENT INSTRUCTIONS
   ───────────────────────────────────────────────────────────── */
/* Place this file at: /var/www/webpages/bingo.emrage.org/css/style.css */

/* ─────────────────────────────────────────────────────────────
   Footer & Impressum Button
   ───────────────────────────────────────────────────────────── */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  text-align: center;
  margin-top: auto;
}

.impressum-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  transition: var(--transition);
}

.impressum-btn:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ─────────────────────────────────────────────────────────────
   Responsive Footer
   ───────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  footer {
    padding: 12px 24px;
    font-size: 0.85rem;
  }

  .impressum-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}
