﻿/**
 * frontend/css/main.css
 * ─────────────────────────────────────────────────────────────
 * Reset, Basis-Stile, globale Komponenten.
 * Wird auf allen Seiten geladen.
 * ─────────────────────────────────────────────────────────────
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import 'variables.css';

/* ── CSS Reset ── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:      var(--font-primary);
  font-size:        var(--text-base);
  font-weight:      var(--font-weight-normal);
  line-height:      1.6;
  color:            var(--color-text);
  background-color: var(--color-bg);

  min-height:       100vh;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, audio {
  display: block;
  max-width: 100%;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size:   inherit;
  outline:     none;
}

/* Browser-Standard-Look von Buttons entfernen (sonst weiße Kästen auf dunklem Grund) */
button {
  background: none;
  border:     none;
  color:      inherit;
  cursor:     pointer;
  text-align: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Typografie ── */

h1, h2, h3, h4, h5, h6 {
  font-weight:  var(--font-weight-bold);
  line-height:  1.2;
  color:        var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-base);}

p {
  color:      var(--color-text-muted);
  line-height: 1.7;
}

/* ── Gold Highlight ── */

.text-gold {
  color: var(--color-gold);
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff, rgba(255,255,255,0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */

.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-2);
  padding:         var(--space-3) var(--space-6);
  border-radius:   var(--radius-lg);
  font-weight:     var(--font-weight-semibold);
  font-size:       var(--text-sm);
  cursor:          pointer;
  border:          none;
  transition:      all var(--transition-normal);
  white-space:     nowrap;
  user-select:     none;
  text-decoration: none;
}

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

/* Primary */
.btn-primary {
  background: var(--color-gold);
  color:      #080808;
}
.btn-primary:hover:not(:disabled) {
  background:  var(--color-gold-hover);
  box-shadow:  var(--shadow-gold);
  transform:   translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary (Outline) */
.btn-secondary {
  background:    transparent;
  color:         var(--color-text);
  border:        1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-gold);
  color:        var(--color-gold);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color:      var(--color-text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-2);
  color:      var(--color-text);
}

/* Danger */
.btn-danger {
  background: transparent;
  color:      var(--color-error);
  border:     1px solid rgba(248, 113, 113, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
}

/* Sizes */
.btn-sm {
  padding:   var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}
.btn-lg {
  padding:   var(--space-4) var(--space-8);
  font-size: var(--text-base);
}
.btn-xl {
  padding:   var(--space-5) var(--space-10);
  font-size: var(--text-lg);
}
.btn-block {
  width: 100%;
}

/* Icon-only */
.btn-icon {
  padding:       var(--space-2);
  aspect-ratio:  1;
  border-radius: var(--radius-md);
}

/* Discord Button */
.btn-discord {
  background: var(--color-discord);
  color:      #fff;
}
.btn-discord:hover:not(:disabled) {
  background: #4752c4;
  transform:  translateY(-1px);
}

/* Google Button */
.btn-google {
  background: var(--color-google);
  color:      #333;
  border:     1px solid #dadce0;
}
.btn-google:hover:not(:disabled) {
  background: #f8f8f8;
  transform:  translateY(-1px);
}

/* ── Forms ── */

.form-group {
  display:       flex;
  flex-direction: column;
  gap:           var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size:   var(--text-sm);
  font-weight: var(--font-weight-medium);
  color:       var(--color-text-muted);
}

.form-input,
.form-textarea,
.form-select {
  width:            100%;
  padding:          var(--space-3) var(--space-4);
  background:       var(--color-surface-2);
  border:           1px solid var(--color-border);
  border-radius:    var(--radius-md);
  color:            var(--color-text);
  font-size:        var(--text-sm);
  transition:       border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-gold);
  box-shadow:   0 0 0 3px var(--color-gold-glow);
}

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

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

.form-select option {
  background: var(--color-surface-2);
}

.form-error {
  font-size: var(--text-xs);
  color:     var(--color-error);
}

.form-hint {
  font-size: var(--text-xs);
  color:     var(--color-text-faint);
}

/* ── Cards ── */

.card {
  background:    var(--color-surface);
  border:        1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding:       var(--space-6);
}

.card-hover {
  transition: all var(--transition-normal);
}
.card-hover:hover {
  border-color: var(--color-border-hover);
  transform:    translateY(-2px);
  box-shadow:   var(--shadow-lg);
}

/* ── Badges ── */

.badge {
  display:       inline-flex;
  align-items:   center;
  padding:       2px var(--space-2);
  border-radius: var(--radius-full);
  font-size:     var(--text-xs);
  font-weight:   var(--font-weight-semibold);
}

.badge-gold {
  background: var(--color-gold-glow);
  color:      var(--color-gold);
  border:     1px solid rgba(255, 255, 255, 0.15);
}

.badge-free {
  background: var(--color-surface-3);
  color:      var(--color-text-muted);
}

/* ── Divider ── */

.divider {
  display:     flex;
  align-items: center;
  gap:         var(--space-4);
  margin:      var(--space-6) 0;
  color:       var(--color-text-faint);
  font-size:   var(--text-sm);
}
.divider::before,
.divider::after {
  content:    '';
  flex:       1;
  height:     1px;
  background: var(--color-border);
}

/* ── Toast Notifications ── */

.toast-container {
  position:  fixed;
  bottom:    var(--space-6);
  right:     var(--space-6);
  z-index:   var(--z-toast);
  display:   flex;
  flex-direction: column;
  gap:       var(--space-2);
}

.toast {
  display:       flex;
  align-items:   center;
  gap:           var(--space-3);
  padding:       var(--space-3) var(--space-4);
  background:    var(--color-surface-2);
  border:        1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow:    var(--shadow-lg);
  font-size:     var(--text-sm);
  min-width:     250px;
  animation:     toastIn 250ms ease forwards;
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error   { border-left: 3px solid var(--color-error);   }
.toast.info    { border-left: 3px solid var(--color-gold);    }

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

/* ── Spinner ── */

.spinner {
  width:         20px;
  height:        20px;
  border:        2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation:     spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utility Classes ── */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.truncate {
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
}

.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-2          { gap: var(--space-2); }
.gap-4          { gap: var(--space-4); }
.gap-6          { gap: var(--space-6); }
.w-full         { width: 100%; }
.mt-4           { margin-top: var(--space-4); }
.mb-4           { margin-bottom: var(--space-4); }
.text-center    { text-align: center; }
.text-sm        { font-size: var(--text-sm); }
.text-muted     { color: var(--color-text-muted); }

/* ── Scrollbar ── */

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-surface-3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-border-hover); }

/* ── Mobile First Responsive ── */

@media (max-width: 640px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .btn-xl { padding: var(--space-4) var(--space-6); font-size: var(--text-base); }
}


