/* ================================================================
   MONARA — Theme System
   Dark (default) + Light (elegant cream)
   ================================================================ */

/* ── CSS Custom Properties — DARK (default) ─────────────────────── */
:root,
[data-theme="dark"] {
  --bg-base:        #0A0A0F;
  --bg-surface:     #14141a;
  --bg-nav:         #0D0D14;
  --bg-input:       #1a1a2a;
  --bg-hover:       #1e1e2e;
  --bg-card:        #111118;

  --border:         #2a2a3a;
  --border-light:   #1e1e28;
  --border-gold:    rgba(200,169,110,0.35);

  --text-primary:   #e0e0e0;
  --text-secondary: #aaaaaa;
  --text-muted:     #666680;
  --text-disabled:  #444460;

  --gold:           #C8A96E;
  --gold-hover:     #d9bc88;
  --gold-bg:        rgba(200,169,110,0.12);
  --gold-border:    rgba(200,169,110,0.3);

  --green:          #52b788;
  --green-bg:       rgba(82,183,136,0.12);
  --red:            #e63946;
  --red-bg:         rgba(230,57,70,0.12);
  --blue:           #4895ef;
  --blue-bg:        rgba(72,149,239,0.12);

  --shadow:         0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --radius:         10px;
  --radius-sm:      6px;

  --nav-link:       rgba(255,255,255,0.5);
  --nav-link-hover: rgba(255,255,255,0.9);

  color-scheme: dark;
}

/* ── CSS Custom Properties — LIGHT (elegant cream) ──────────────── */
[data-theme="light"] {
  --bg-base:        #F4F1EB;
  --bg-surface:     #FFFFFF;
  --bg-nav:         #0D0D14;   /* nav stays dark — MONARA brand */
  --bg-input:       #F0EBE2;
  --bg-hover:       #EDE8DF;
  --bg-card:        #FDFAF6;

  --border:         #DDD6CA;
  --border-light:   #EAE4DB;
  --border-gold:    rgba(180,140,80,0.4);

  --text-primary:   #1A1825;
  --text-secondary: #4A4560;
  --text-muted:     #8A8098;
  --text-disabled:  #BDB5C8;

  --gold:           #B8944A;
  --gold-hover:     #C9A55B;
  --gold-bg:        rgba(184,148,74,0.10);
  --gold-border:    rgba(184,148,74,0.3);

  --green:          #2d8c5e;
  --green-bg:       rgba(45,140,94,0.10);
  --red:            #c0392b;
  --red-bg:         rgba(192,57,43,0.10);
  --blue:           #2563eb;
  --blue-bg:        rgba(37,99,235,0.10);

  --shadow:         0 4px 24px rgba(0,0,0,0.08);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.06);

  --nav-link:       rgba(255,255,255,0.6);
  --nav-link-hover: rgba(255,255,255,0.95);

  color-scheme: light;
}

/* ── Base Styles ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .25s, color .25s;
  -webkit-tap-highlight-color: transparent;
}

/* ── Navigation ─────────────────────────────────────────────────── */
.mn-nav {
  overflow: hidden;
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
}

/* ── Language Flags (inline, alle sichtbar) ─────────────────── */
.mn-lang-flags {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mn-lang-flags::-webkit-scrollbar { display: none; }
.mn-lang-flags a { font-size: .88rem; }
@media (max-width: 480px) {
  .mn-lang-flags a { font-size: .7rem; padding: 1px 2px !important; }
}
/* ──────────────────────────────────────────────────────────── */
.mn-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mn-logo {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .12em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.mn-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.mn-links a {
  color: var(--nav-link);
  font-size: .82rem;
  text-decoration: none;
  transition: color .15s;
  letter-spacing: .02em;
}
.mn-links a:hover { color: var(--nav-link-hover); }
.mn-links a.active { color: var(--gold); }

/* ── Nav Actions (right side) ───────────────────────────────────── */
.mn-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mn-icon-btn {
  background: transparent;
  border: none;
  color: var(--nav-link);
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.mn-icon-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--nav-link-hover);
}

/* ── Language Dropdown ──────────────────────────────────────────── */
.lang-wrap { position: relative; }
.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--nav-link);
  font-size: .75rem;
  padding: 4px 8px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all .15s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1a1a28;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.lang-menu.lang-open { display: block; }
.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .8rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: background .1s, color .1s;
}
.lang-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.lang-item.active { color: var(--gold); background: var(--gold-bg); }

/* ── Theme Toggle ───────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--nav-link);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* ── Mobile Hamburger ───────────────────────────────────────────── */
.mn-burger {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

/* ── Mobile Nav Drawer ──────────────────────────────────────────── */
.mn-mobile {
  display: none;
  background: #0D0D14;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px 20px;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.mn-mobile.nav-open { display: flex; }
.mn-mobile a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: .9rem;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: color .15s;
}
.mn-mobile a:hover { color: var(--gold); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-gold {
  background: var(--gold);
  color: #0A0A0F;
  font-weight: 600;
  padding: .55rem 1.3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .82rem;
  letter-spacing: .02em;
  transition: opacity .2s, transform .1s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-gold:hover { opacity: .85; }
.btn-gold:active { transform: scale(.98); }

.btn-outline {
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: .52rem 1.3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .82rem;
  transition: all .2s;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--gold); color: #0A0A0F; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: .52rem 1.2rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .82rem;
  transition: all .15s;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* ── Form Inputs ────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: .875rem;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--gold); }
.label {
  display: block;
  color: var(--text-muted);
  font-size: .78rem;
  margin-bottom: 5px;
  letter-spacing: .03em;
}

/* ── Cards / Surfaces ───────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── Flash Messages ─────────────────────────────────────────────── */
.flash-ok {
  background: var(--green-bg);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .85rem;
}
.flash-err {
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .85rem;
}

/* ── Card Display (Collectible Cards) ───────────────────────────── */
.card-ratio {
  aspect-ratio: 2.5 / 3.5;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform .3s;
}
.card-img:hover { transform: scale(1.02); }

/* ── Responsive Grid ────────────────────────────────────────────── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
@media (max-width: 600px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (min-width: 900px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ── Main content area ──────────────────────────────────────────── */
.mn-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
}
.mn-alerts { margin-bottom: 16px; }

/* ── Footer ─────────────────────────────────────────────────────── */
.mn-footer {
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  margin-top: auto;
  background: var(--bg-surface);
}
.mn-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
}
.mn-footer-logo {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: .95rem;
  margin-bottom: 8px;
}
.mn-footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.mn-footer-links a { color: var(--text-muted); text-decoration: none; white-space: nowrap; font-size: .82rem; }
.mn-footer-links a:hover { color: var(--text-primary); }
@media (max-width: 480px) {
  .mn-footer-links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .mn-footer-links a { font-size: .8rem; }
}

/* ── Mobile Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .mn-links { display: none; }
  .mn-burger { display: flex; align-items: center; }
  .login-label { display: none; }
  .login-icon { display: inline !important; }
  .mn-login-btn { padding: .35rem .5rem; font-size: 1rem; line-height: 1; }
  .mn-main { padding: 16px 12px; }
  .hide-mobile { display: none !important; }
  .mn-actions .btn-gold,
  .mn-actions .btn-outline { padding: .45rem .8rem; font-size: .78rem; }
  .mn-nav-inner { gap: 8px; padding: 0 10px; }
  .mn-actions { gap: 6px; }
}

/* Klein-Mobile: nur Hamburger + Register + Lang sichtbar */

/* ── Mobile Nav: 2 Zeilen ───────────────────────────────────── */
@media (max-width: 600px) {
  .mn-nav-inner {
    flex-wrap: wrap;
    padding: 6px 12px 4px;
    gap: 0;
  }
  /* Zeile 1: Logo zentriert, volle Breite */
  .mn-logo {
    width: 100%;
    text-align: center;
    padding: 4px 0 2px;
    font-size: 1rem;
  }
  /* Zeile 2: Flaggen + Login-Icon */
  .mn-actions {
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 2px 0 4px;
  }
  .mn-links { display: none; }
  .theme-toggle { display: none; }
  .hide-mobile { display: none !important; }
  /* Login: nur Icon auf Mobile */
  .mn-login-btn .login-label { display: none; }
  .mn-login-btn .login-icon { display: inline; }
  .mn-login-btn {
    padding: .3rem .5rem;
    font-size: 1rem;
    min-width: auto;
    line-height: 1;
  }
}
/* Desktop: Login-Icon verstecken */
@media (min-width: 601px) {
  .login-icon { display: none; }
}
/* ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .mn-nav-inner { padding: 0 8px; gap: 4px; }
  .mn-actions { gap: 3px; }
  .theme-toggle { display: none; }
  .mn-actions .btn-gold,
  .mn-actions .btn-outline { padding: .35rem .6rem; font-size: .72rem; letter-spacing: 0; }
  .mn-logo { font-size: .9rem; letter-spacing: .06em; }
  .mn-lang-flags a { font-size: .7rem; padding: 1px 2px !important; }
}
@media (min-width: 769px) {
  .mn-burger { display: none; }
  .mn-mobile { display: none !important; }
}

/* ── Tablet ──────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .mn-links { gap: 14px; }
  .mn-links a { font-size: .8rem; }
}

/* ── Tables ─────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 8px 12px; color: var(--text-muted);
     font-size: .78rem; border-bottom: 1px solid var(--border); font-weight: 500; }
td { padding: 10px 12px; font-size: .84rem; border-bottom: 1px solid var(--border-light); }
tr:hover td { background: var(--bg-hover); }

/* Responsive tables on mobile */
@media (max-width: 640px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.badge-gold   { background: var(--gold-bg);   color: var(--gold);   border: 1px solid var(--gold-border); }
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue); }
.badge-muted  { background: rgba(128,128,128,.1); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Utility ─────────────────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.bg-surface   { background: var(--bg-surface); }
.border-base  { border: 1px solid var(--border); }
.font-cinzel  { font-family: 'Cinzel', serif; }
.rounded      { border-radius: var(--radius); }
.rounded-sm   { border-radius: var(--radius-sm); }

/* ── Language Select ─────────────────────────────────── */
#lang-select option {
  background: var(--bg-nav, #0A0A0F);
  color: var(--text-primary, #e0d5c5);
}
#lang-select:focus {
  outline: none;
  border-color: var(--gold) !important;
}


/* ══════════════════════════════════════════════════════════════════
   GLOBAL RESPONSIVE FIXES — Mobile First
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Max-width containers → full width with padding */
  [style*="max-width:860px"],
  [style*="max-width:900px"],
  [style*="max-width:960px"],
  [style*="max-width:1100px"],
  [style*="max-width:1200px"],
  [style*="max-width:700px"],
  [style*="max-width:720px"],
  [style*="max-width:780px"],
  [style*="max-width:800px"] {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Two-column grids → single column */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Fixed widths on forms/cards → full width */
  [style*="width:500px"],
  [style*="width:600px"],
  [style*="width:640px"],
  [style*="width:680px"],
  [style*="width:700px"],
  [style*="width:720px"],
  [style*="width:860px"],
  [style*="width:900px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Auth forms */
  [style*="max-width:420px"],
  [style*="max-width:500px"] {
    max-width: calc(100% - 32px) !important;
  }

  /* Stat grids on dashboard */
  .dash-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* Tables → horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Font sizes */
  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.1rem !important; }

  /* Checkout grid */
  .checkout-grid {
    grid-template-columns: 1fr !important;
  }

  /* Order show grid */
  [style*="grid-template-columns:3fr 2fr"],
  [style*="grid-template-columns: 3fr 2fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Horizontal scroll containers */
  .overflow-x-scroll,
  [style*="overflow-x:auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  /* Stat tiles → full width */
  .dash-stats {
    grid-template-columns: 1fr !important;
  }

  /* Navigation flags smaller */
  .mn-lang-flags a {
    font-size: .65rem !important;
  }
}
