/* ═══════════════════════════════════════════════════════════════════════════
   vipmail.app FAQ Stylesheet
   EXAKT wie Hauptseite: Dunkler Hintergrund, Sternenhimmel, gleiche Farben
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0f14;
  --card-start: #1a2332;
  --card-end: #0f1620;
  --btn: #1e293b;
  --btn-h: #2d3d55;
  --text: #e6edf3;
  --link: #0ea5e9;
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.3);
}

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

/* BODY mit STERNEN HINTERGRUND wie Hauptseite ─────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Layer 1: Far stars */
body::before {
  background-image:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(2px 2px at 50% 50%, white, transparent),
    radial-gradient(2px 2px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, white, transparent),
    radial-gradient(2px 2px at 30% 80%, white, transparent),
    radial-gradient(2px 2px at 70% 40%, white, transparent),
    radial-gradient(2px 2px at 10% 90%, white, transparent),
    radial-gradient(2px 2px at 40% 20%, white, transparent),
    radial-gradient(2px 2px at 85% 85%, white, transparent),
    radial-gradient(2px 2px at 15% 50%, white, transparent),
    radial-gradient(2px 2px at 95% 35%, white, transparent),
    radial-gradient(1px 1px at 25% 60%, white, transparent),
    radial-gradient(1px 1px at 75% 20%, white, transparent),
    radial-gradient(1px 1px at 35% 90%, white, transparent),
    radial-gradient(1px 1px at 55% 45%, white, transparent),
    radial-gradient(1px 1px at 5% 75%, white, transparent),
    radial-gradient(1px 1px at 92% 12%, white, transparent);
  background-size: 200% 200%;
  animation: starsFloat 120s linear infinite, starsTwinkle 8s ease-in-out infinite;
  opacity: 0.5;
}

/* Layer 2: Mid stars */
body::after {
  background-image:
    radial-gradient(3px 3px at 25% 40%, #0ea5e9, transparent),
    radial-gradient(2px 2px at 75% 65%, white, transparent),
    radial-gradient(2px 2px at 45% 85%, white, transparent),
    radial-gradient(3px 3px at 65% 25%, #0ea5e9, transparent),
    radial-gradient(2px 2px at 35% 55%, white, transparent),
    radial-gradient(3px 3px at 85% 75%, #0ea5e9, transparent),
    radial-gradient(2px 2px at 15% 15%, white, transparent),
    radial-gradient(2px 2px at 55% 95%, white, transparent),
    radial-gradient(2px 2px at 12% 48%, #0ea5e9, transparent),
    radial-gradient(2px 2px at 88% 32%, white, transparent),
    radial-gradient(3px 3px at 42% 68%, #0ea5e9, transparent),
    radial-gradient(2px 2px at 68% 8%, white, transparent);
  background-size: 220% 220%;
  animation: starsFloat 80s linear infinite reverse, starsTwinkle 6s ease-in-out infinite 1s;
  opacity: 0.7;
}

@keyframes starsFloat {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

@keyframes starsTwinkle {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.content {
  position: relative;
  z-index: 10;
}

/* PRELOADER wie Hauptseite ────────────────────────────────────────────────── */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0b0f14 0%, #1a2332 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.preloader-logo {
  width: 160px;
  height: 160px;
  margin-bottom: 40px;
  animation: logoAppear 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 30px var(--accent-glow));
}

.preloader-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoAppear {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.preloader-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 30px;
  animation: textPulse 2s ease-in-out infinite;
  letter-spacing: 2px;
}

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

.preloader-bar {
  width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.preloader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #06b6d4 50%, var(--accent) 100%);
  background-size: 200% 100%;
  animation: progressFlow 2s ease-in-out forwards, shimmer 1.5s linear infinite;
  border-radius: 10px;
  box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes progressFlow {
  0% { width: 0; }
  100% { width: 100%; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body.loaded .content {
  animation: contentFadeIn 0.8s ease 0.3s both;
}

@keyframes contentFadeIn {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* HEADER ───────────────────────────────────────────────────────────────────── */
.faq-header {
  text-align: center;
  padding: 80px 20px 40px;
  background: transparent;
}

.faq-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  animation: headerLogoAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.faq-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

@keyframes headerLogoAppear {
  0% { transform: scale(0) rotate(-90deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.faq-header h1 {
  font-size: 3.2rem;
  font-weight: 900;
  margin: 0 0 15px;
  letter-spacing: .05em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleFloat 6s ease-in-out infinite;
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.faq-subtitle {
  font-size: 1.2rem;
  color: rgba(230, 237, 243, 0.7);
  font-weight: 500;
}

/* LAYOUT ───────────────────────────────────────────────────────────────────── */
.faq-container {
  display: grid;
  grid-template-columns: 250px 1fr 300px;
  gap: 30px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.faq-toc {
  position: sticky;
  top: 20px;
  height: fit-content;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(26, 35, 50, 0.5) 0%, rgba(15, 22, 32, 0.5) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.faq-toc h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.faq-toc ul {
  list-style: none;
}

.faq-toc li {
  margin-bottom: 8px;
}

.faq-toc a {
  color: rgba(230, 237, 243, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.faq-toc a:hover,
.faq-toc a:focus {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.1);
  outline: none;
}

.faq-toc a.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.2);
  font-weight: 600;
}

/* MAIN CONTENT ─────────────────────────────────────────────────────────────── */
.faq-main {
  min-width: 0;
}

.faq-section {
  margin-bottom: 50px;
  scroll-margin-top: 80px;
}

.faq-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 25px;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding-left: 20px;
}

.faq-item {
  background: linear-gradient(135deg, rgba(26, 35, 50, 0.4) 0%, rgba(15, 22, 32, 0.4) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.1);
}

.faq-question {
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-question:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq-question[aria-expanded="true"] {
  color: var(--accent);
}

.faq-arrow {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-question[aria-expanded="true"] .faq-arrow {
  transform: rotate(90deg);
}

.faq-answer {
  padding: 0 20px 20px;
  color: rgba(230, 237, 243, 0.9);
  line-height: 1.8;
  font-size: 0.95rem;
  display: flex;
  gap: 15px;
  animation: answerSlide 0.3s ease;
}

.faq-answer[hidden] {
  display: none !important;
}

@keyframes answerSlide {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.faq-answer p {
  flex: 1;
}

.faq-copy {
  flex-shrink: 0;
  padding: 8px 12px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  align-self: flex-start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.faq-copy:hover {
  background: rgba(14, 165, 233, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.faq-copy:active {
  transform: translateY(0);
}

.faq-copy:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.faq-copy-icon,
.faq-copy-check {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-copy-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.faq-copy-check {
  opacity: 0;
  transform: scale(0) rotate(-90deg);
}

.faq-copy.copied .faq-copy-icon {
  opacity: 0;
  transform: scale(0) rotate(90deg);
}

.faq-copy.copied .faq-copy-check {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

mark {
  background: rgba(234, 179, 8, 0.3);
  color: var(--text);
  padding: 2px 4px;
  border-radius: 3px;
}

/* SIDEBAR ──────────────────────────────────────────────────────────────────── */
.faq-sidebar {
  position: sticky;
  top: 20px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-search-box {
  background: linear-gradient(135deg, rgba(26, 35, 50, 0.5) 0%, rgba(15, 22, 32, 0.5) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  padding: 15px;
}

.faq-search {
  width: 100%;
  padding: 12px 15px;
  background: rgba(11, 15, 20, 0.6);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.faq-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.faq-filters {
  background: linear-gradient(135deg, rgba(26, 35, 50, 0.5) 0%, rgba(15, 22, 32, 0.5) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  padding: 15px;
}

.faq-filters h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.faq-filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-filters label:hover {
  color: var(--accent);
}

.faq-filters input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.faq-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-btn:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3) 0%, rgba(14, 165, 233, 0.2) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.faq-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* TOAST ────────────────────────────────────────────────────────────────────── */
.faq-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
  color: var(--bg);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.4);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
  pointer-events: none;
}

@keyframes toastIn {
  0% { transform: translateX(400px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(400px); opacity: 0; }
}

/* FOOTER ───────────────────────────────────────────────────────────────────── */
.faq-footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 1px solid rgba(14, 165, 233, 0.2);
  color: rgba(230, 237, 243, 0.7);
  font-size: 0.9rem;
}

.faq-footer p {
  margin: 5px 0;
}

.faq-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.faq-footer a:hover {
  color: #06b6d4;
  text-decoration: underline;
}

/* PRINT STYLES ─────────────────────────────────────────────────────────────── */
@media print {
  .preloader,
  .faq-header,
  .faq-sidebar,
  .faq-footer,
  .faq-toc {
    display: none !important;
  }
  
  body,
  body::before,
  body::after {
    background: white !important;
    color: black !important;
    animation: none !important;
  }
  
  .content {
    animation: none !important;
  }
  
  .faq-container {
    display: block;
  }
  
  .faq-main {
    width: 100%;
  }
  
  .faq-section {
    page-break-inside: avoid;
  }
  
  .faq-section h2 {
    color: black !important;
    border-left-color: black !important;
    page-break-after: avoid;
  }
  
  .faq-item {
    background: white !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    margin-bottom: 15px;
  }
  
  .faq-question {
    color: black !important;
    background: #f5f5f5 !important;
  }
  
  .faq-answer {
    display: block !important;
    color: black !important;
  }
  
  .faq-answer[hidden] {
    display: block !important;
  }
  
  .faq-copy {
    display: none !important;
  }
  
  .faq-arrow {
    display: none;
  }
  
  a {
    color: #0066cc !important;
    text-decoration: underline;
  }
  
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* RESPONSIVE ───────────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .faq-container {
    grid-template-columns: 220px 1fr 280px;
    gap: 20px;
  }
}

@media (max-width: 1200px) {
  .faq-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .faq-toc,
  .faq-sidebar {
    position: static;
    max-height: none;
  }
  
  .faq-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .faq-header h1 {
    font-size: 2.5rem;
  }
  
  .faq-subtitle {
    font-size: 1rem;
  }
  
  .faq-section h2 {
    font-size: 1.6rem;
  }
  
  .faq-question {
    font-size: 0.95rem;
    padding: 15px;
  }
  
  .faq-answer {
    font-size: 0.9rem;
    flex-direction: column;
  }
  
  .faq-copy {
    align-self: flex-start;
  }
  
  .faq-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .faq-header {
    padding: 60px 15px 30px;
  }
  
  .faq-logo {
    width: 70px;
    height: 70px;
  }
  
  .faq-header h1 {
    font-size: 2rem;
  }
  
  .faq-container {
    padding: 15px;
  }
  
  .faq-section h2 {
    font-size: 1.4rem;
  }
  
  .faq-question {
    font-size: 0.9rem;
    padding: 12px;
  }
  
  .faq-answer {
    padding: 0 12px 12px;
    font-size: 0.85rem;
  }
  
  .preloader-logo {
    width: 120px;
    height: 120px;
  }
  
  .preloader-text {
    font-size: 1.2rem;
  }
  
  .preloader-bar {
    width: 220px;
  }
}

/* PREFERS REDUCED MOTION ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body::before,
  body::after {
    animation: none !important;
  }
  
  .preloader-logo,
  .preloader-text,
  .preloader-progress,
  .faq-header h1,
  .faq-logo {
    animation: none !important;
  }
}
