/*
 * PunkteBuddy – Gemeinsame Base-Styles
 * https://www.punktebuddy.de/shared/base.css
 *
 * Einmal hier updaten → alle Buddy-Apps werden aktualisiert.
 *
 * Laden-Reihenfolge in index.html:
 *   1. base.css       ← dieses File (Reset, Variablen, Buttons, Cards, Modals...)
 *   2. gamebar.css    ← Gamebar-Layout
 *   3. styles.css     ← App-spezifische Styles (überschreibt bei Bedarf)
 *
 * Jede App definiert in ihrer eigenen styles.css:
 *   :root {
 *     --bg-color: #0f172a;
 *     --primary-color: #6366f1;     ← App-Farbe
 *     --secondary-color: #8b5cf6;   ← App-Sekundärfarbe
 *   }
 *   body { background: linear-gradient(135deg, #0f172a 0%, #1a1040 100%); }
 */

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BASIS-VARIABLEN (App überschreibt --primary-color + --secondary-color) ===== */
:root {
  --card-bg:       #1e293b;
  --text-color:    #f1f5f9;
  --text-muted:    #94a3b8;
  --border-color:  #334155;
  --success-color: #10b981;
  --danger-color:  #ef4444;
  --warning-color: #f59e0b;
}

/* ===== BODY ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: block;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

/* ===== TYPOGRAFIE ===== */
h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary-color, #6366f1), var(--secondary-color, #8b5cf6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-color);
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

/* ===== BUTTONS ===== */
.btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color, #6366f1), var(--secondary-color, #8b5cf6));
  color: white;
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:active {
  transform: scale(0.98);
}

.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
  margin-top: 0;
}

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

/* ===== FORMULARE ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color, #0f172a);
  color: var(--text-color);
  transition: border-color 0.3s;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color, #6366f1);
}

/* ===== MELDUNGEN ===== */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}

.message-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.message-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s;
}

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

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* ===== STICKY HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg, #1e293b);
  border-bottom: 1px solid var(--border-color, #334155);
  padding: 12px 16px;
}

/* ===== BETA-BADGE ===== */
.beta-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ===== FEEDBACK-SEKTION ===== */
.feedback-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.feedback-section h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== LADEANIMATION ===== */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color, #6366f1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}

/* ===== ANIMATIONEN ===== */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .screen   { padding: 12px; }
  h1        { font-size: 1.6rem; }
  .card     { padding: 16px; }
  .btn      { padding: 12px 20px; }
  .modal-body    { padding: 16px; }
  .modal-header  { padding: 16px; }
}
