/* =========================================================
   Pickleball Platform — Main Stylesheet
   (ausgelagert aus index.php)
   ========================================================= */

/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  background: #fff;
}

/* ---------------------------------
   Header & Navigation
   --------------------------------- */
.header {
  background: #1a365d;
  color: #fff;
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(26, 54, 93, 0.3);
  border-bottom: 3px solid #2c5282;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
}
.logo:hover { opacity: .9; }

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all .3s ease;
  padding: .5rem 1rem;
  border-radius: 25px;
}
.nav-menu a:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all .3s ease;
  padding: .5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  padding: .5rem 0;
  min-width: 220px;
  z-index: 1000;
  margin-top: -10px;
  padding-top: 15px;
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0; right: 0;
  height: 10px;
  background: transparent;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }

/* Dropdown Toggle State */
.nav-dropdown.dropdown-open .nav-dropdown-menu {
  display: block !important;
}

.nav-dropdown-menu a {
  display: block;
  padding: .7rem 1.5rem;
  color: #1a365d;
  text-decoration: none;
  transition: all .3s ease;
  font-weight: 500;
}
.nav-dropdown-menu a:hover {
  background: #f7fafc;
  color: #2c5282;
  transform: translateX(5px);
}

/* Subdropdown (Cup Events) */
.nav-subdropdown { position: relative; }
.nav-subdropdown > a {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}

/* (Verbesserter) Subdropdown Flyout – flickerfrei */
.nav-subdropdown-menu {
  /* dauerhaft im Layout, aber unsichtbar → verhindert Hover-Gap */
  display: block;
  visibility: hidden;
  opacity: 0;
  transition: opacity .12s ease;
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  padding: .5rem 0;
  min-width: 200px;
  z-index: 1001;
}

/* unsichtbare „Brücke" zwischen Parent und Submenu */
.nav-subdropdown-menu::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 0; bottom: 0;
  width: 12px;
  background: transparent;
}

/* sichtbar bei Hover/Intent */
.nav-subdropdown:hover .nav-subdropdown-menu,
.nav-subdropdown.open .nav-subdropdown-menu {
  visibility: visible;
  opacity: 1;
}

.nav-subdropdown-menu a {
  display: flex; align-items: center;
  padding: .7rem 1.5rem;
  color: #1a365d; text-decoration: none; font-weight: 500;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.nav-subdropdown-menu a:hover {
  background: #f7fafc; color: #2c5282; transform: translateX(5px);
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Switcher */
.language-switcher { position: relative; }

.language-dropdown {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: .5rem 1rem;
  color: #fff;
  cursor: pointer;
  transition: all .3s ease;
  display: flex; align-items: center; gap: .5rem;
}
.language-dropdown:hover { background: rgba(255,255,255,0.2); }

.language-options {
  position: absolute;
  top: 100%; right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  padding: .5rem 0;
  min-width: 150px;
  display: none;
  z-index: 1001;
  max-height: 400px;
  overflow-y: auto;
}
.language-options.show { display: block; }

.language-option {
  padding: .7rem 1rem;
  color: #1a365d;
  cursor: pointer;
  transition: all .3s ease;
  display: flex; align-items: center; gap: .5rem;
}
.language-option:hover { background: #f7fafc; }
.language-option.active { background: #e6f3ff; font-weight: 600; }

/* Buttons */
.auth-buttons { display: flex; gap: 1rem; }

.btn {
  padding: .8rem 1.8rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: all .3s ease;
  display: inline-flex; align-items: center; gap: .5rem;
  position: relative; overflow: hidden;
}

.btn-primary {
  background: #2c5282; color: #fff;
  box-shadow: 0 4px 15px rgba(44,82,130,.3);
  border: 2px solid #2c5282;
}
.btn-primary:hover {
  background: #2d3748; transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(44,82,130,.4);
}

.btn-secondary {
  background: transparent; color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 15px rgba(255,255,255,.1);
}
.btn-secondary:hover {
  background: #fff; color: #1a365d; transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255,255,255,.3);
}

/* ---------------------------------
   Hero
   --------------------------------- */
.hero {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  color: #fff;
  padding: 8rem 2rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.08)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.06)"/><circle cx="40" cy="80" r="2" fill="rgba(255,255,255,0.08)"/></svg>');
  animation: float 20s infinite linear;
}
@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-100vh) rotate(360deg); }
}

.hero-content { max-width: 800px; margin: 0 auto; position: relative; z-index: 2; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; animation: slideInUp 1s ease; }
.hero p  { font-size: 1.3rem; margin-bottom: 2rem; opacity: .9; animation: slideInUp 1s ease .2s both; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; animation: slideInUp 1s ease .4s both; }

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

/* ---------------------------------
   Features
   --------------------------------- */
.features { padding: 6rem 2rem; background: #f8f9fa; }

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

.section-title { text-align: center; margin-bottom: 4rem; }
.section-title h2 {
  font-size: 2.8rem; margin-bottom: 1rem; color: #1a365d; font-weight: 800;
}
.section-title p {
  font-size: 1.2rem; color: #4a5568; max-width: 600px; margin: 0 auto; line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(26, 54, 93, .1);
  text-align: center;
  transition: all .4s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.feature-card::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(26,54,93,.03), transparent);
  transition: all .6s ease;
}
.feature-card:hover::before { left: 100%; }
.feature-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(26, 54, 93, .15);
  border-color: #2c5282;
}

.feature-icon {
  font-size: 3.5rem; margin-bottom: 1.5rem; color: #1a365d;
  background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 15px rgba(26, 54, 93, .1);
}
.feature-card h3 { font-size: 1.6rem; margin-bottom: 1rem; color: #1a365d; font-weight: 700; }
.feature-card p  { color: #4a5568; line-height: 1.6; }

/* ---------------------------------
   Stats
   --------------------------------- */
.stats {
  background: #1a365d; color: #fff; padding: 5rem 2rem; position: relative;
}
.stats::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(44,82,130,.1) 50%, transparent 70%);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  text-align: center;
  position: relative; z-index: 2;
}
.stat-item {
  background: rgba(255,255,255,.05);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,.1);
  border: 1px solid rgba(255,255,255,.1);
  transition: all .3s ease;
}
.stat-item:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(0,0,0,.15);
}
.stat-item h3 {
  font-size: 3.5rem; margin-bottom: .5rem; font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #e6f3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-item p { font-size: 1.2rem; opacity: .9; font-weight: 500; }

/* ---------------------------------
   Mobile Menu & Responsive
   --------------------------------- */
.mobile-menu { display: none; }

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a365d;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 999;
  }
  
  .nav-menu.mobile-open {
    display: flex !important;
  }
  
  .nav-dropdown-menu {
    position: static;
    display: none;
    margin-top: 0.5rem;
    margin-left: 1rem;
  }
  
  .nav-dropdown.dropdown-open .nav-dropdown-menu {
    display: block !important;
  }
  
  .mobile-menu {
    display: block;
    background: none; border: none; color: #fff;
    font-size: 1.5rem; cursor: pointer;
  }
  .hero h1 { font-size: 2.5rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header-right { gap: .5rem; }
  .auth-buttons { display: none; }
}

/* ---------------------------------
   Footer
   --------------------------------- */
.footer {
  background: #1a365d; color: #fff; padding: 4rem 2rem 2rem; position: relative;
}
.footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #2c5282 0%, #4299e1 50%, #2c5282 100%);
}
.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}
.footer-section h3 {
  margin-bottom: 1.5rem; color: #fff; font-weight: 700; font-size: 1.2rem;
}
.footer-section a {
  color: #cbd5e0; text-decoration: none; display: block; margin-bottom: .8rem;
  transition: all .3s ease; padding: .3rem 0;
}
.footer-section a:hover { color: #fff; transform: translateX(5px); }
.footer-bottom {
  text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #2c5282; color: #cbd5e0;
}

/* ---------------------------------
   Loading Overlay & Spinner
   --------------------------------- */
.loading {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,.9);
  z-index: 9999;
  justify-content: center; align-items: center;
}
.spinner {
  width: 50px; height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #1a365d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Translation Loading State */
.translating { opacity: 1; transition: opacity .2s ease; }

/* ---------------------------------
   Modal (Login / Register)
   --------------------------------- */
.modal {
  display: none;
  position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,.7);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 12px;
  width: 90%; max-width: 450px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  position: relative;
  animation: slideIn .3s ease;
}
@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.close {
  color: #aaa;
  position: absolute; top: .5rem; right: 1rem;
  font-size: 28px; font-weight: bold;
  cursor: pointer; transition: color .3s ease;
  z-index: 10;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
}
.close:hover, .close:focus { color: #1a365d; }

.modal h2 {
  color: #1a365d; text-align: center; margin-bottom: 1.5rem;
  font-size: 1.8rem; font-weight: 700;
}

.modal form { display: flex; flex-direction: column; gap: .75rem; }

.modal input,
.modal select {
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color .3s ease;
  background-color: #f8f9fa;
  width: 100%;
}
.modal input:focus,
.modal select:focus {
  outline: none; border-color: #2c5282; background-color: #fff;
}

.modal .btn { margin-top: 1rem; width: 100%; padding: 1rem; font-size: 18px; }

.modal-footer-text { text-align: center; color: #4a5568; margin-top: 1.5rem; font-size: .95rem; }
.modal-footer-text a {
  color: #2c5282; text-decoration: none; font-weight: 600; transition: color .3s ease;
}
.modal-footer-text a:hover { color: #1a365d; text-decoration: underline; }

/* Modal mobile tweaks */
@media (max-width: 480px) {
  .modal input { padding: .75rem; font-size: 14px; }
  .modal-content { margin: 10% auto; padding: 1.5rem; width: 95%; }
  .modal h2 { font-size: 1.5rem; margin-bottom: 1rem; }
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem; margin-bottom: 1rem; border-radius: 8px; font-weight: 500;
  animation: slideIn .3s ease;
}
.alert-error  { background: #fee; color: #c53030; border: 1px solid #feb2b2; }
.alert-success{ background: #f0fff4; color: #2f855a; border: 1px solid #9ae6b4; }

/* ---------------------------------
   Extended Registration Styles
   --------------------------------- */
#registerModal input[type="radio"]:checked + i { color: #2c5282 !important; }
#registerModal label:has(input[type="radio"]:checked) {
  background: rgba(44,82,130,.1);
  border-color: #2c5282;
}
#registerModal select:focus,
#registerModal input[type="date"]:focus {
  outline: none; border-color: #2c5282; background: #fff;
}

/* Scrollbars */
#registerModal .modal-content::-webkit-scrollbar,
.language-options::-webkit-scrollbar { width: 8px; }
#registerModal .modal-content::-webkit-scrollbar-track,
.language-options::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
#registerModal .modal-content::-webkit-scrollbar-thumb,
.language-options::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
#registerModal .modal-content::-webkit-scrollbar-thumb:hover,
.language-options::-webkit-scrollbar-thumb:hover { background: #555; }

/* Tweak: language options narrower scrollbar on desktop */
@media (min-width: 769px) {
  .language-options::-webkit-scrollbar { width: 6px; }
}

/* Utility */
.hidden { display: none !important; }