/* ═══════════════════════════════════════════════════════════
   KAHVE FALIM — COSMIC DARK THEME  (shared design system)
   Reference: celestial-events.html
   ═══════════════════════════════════════════════════════════ */

/* ── 1. CSS Variables ──────────────────────────────────────── */
:root {
  --deep-space:     #02020f;
  --midnight:       #070720;
  --nebula:         #0d0d35;
  --cosmic-purple:  #4a1a8c;
  --stardust:       #7b5ea7;
  --moonlight:      #c8b8e8;
  --gold:           #f0c060;
  --gold-light:     #ffd98a;
  --silver:         #d0d8f0;
  --accent:         #6ee7f7;
  --danger-red:     #ff6b6b;
  --emerald:        #4ecca3;
  --rose:           #f7a8c4;
  /* legacy mapping so existing vars still work */
  --card-bg:        rgba(13, 13, 53, 0.80);
  --surface-muted:  rgba(13, 13, 53, 0.60);
  --muted-text:     var(--moonlight);
  --shadow-lg:      0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-md:      0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── 2. Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Raleway', 'Inter', 'Segoe UI', sans-serif;
  background: var(--deep-space);
  color: var(--silver);
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
  /* kill any bright gradient from old themes */
  animation: none !important;
  background-size: auto !important;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', 'Playfair Display', 'Times New Roman', serif;
  color: #ffffff;
  line-height: 1.2;
}

/* Brand script font */
.brand-wordmark,
.accent-script,
.logo-title,
.nav-logo-text {
  font-family: 'Great Vibes', cursive;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: var(--gold) !important;
}

p { font-size: 1rem; line-height: 1.7; }

/* ── 3. Animated Nebula Background Layers ──────────────────── */
.nebula-layer {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.07;
}
.nebula-1 {
  width: 600px; height: 600px;
  background: var(--cosmic-purple);
  top: -100px; left: -150px;
  animation: nebulaDrift1 30s ease-in-out infinite alternate;
}
.nebula-2 {
  width: 500px; height: 500px;
  background: #0a4a7c;
  bottom: 10%; right: -100px;
  animation: nebulaDrift2 40s ease-in-out infinite alternate;
}
.nebula-3 {
  width: 400px; height: 400px;
  background: #2a0a6a;
  top: 40%; left: 30%;
  animation: nebulaDrift1 50s ease-in-out infinite alternate-reverse;
  opacity: 0.05;
}
@keyframes nebulaDrift1 { to { transform: translate(60px, 40px); } }
@keyframes nebulaDrift2 { to { transform: translate(-50px, -60px); } }

/* ── 4. Floating Cosmic Icons ──────────────────────────────── */
.float-icon,
.floating-icon {
  position: fixed;
  font-size: 1.6rem;
  opacity: 0.16;
  pointer-events: none;
  z-index: 1;
  animation: floatDrift linear infinite;
  filter: blur(0.4px);
}
@keyframes floatDrift {
  0%   { transform: translateY(0px) rotate(0deg); opacity: 0.10; }
  50%  { transform: translateY(-28px) rotate(180deg); opacity: 0.22; }
  100% { transform: translateY(0px) rotate(360deg); opacity: 0.10; }
}

.floating-elements span {
  position: fixed;
  opacity: 0.14;
  pointer-events: none;
  z-index: 1;
  animation: floatDrift linear infinite;
  filter: blur(0.3px);
  font-size: clamp(1.4rem, 3vw, 2.8rem);
}

/* ── 5. Cosmic Navigation ──────────────────────────────────── */
nav.cosmic-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(2, 2, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(200, 184, 232, 0.12);
  transition: background 0.3s;
  width: 100%;
}
nav.cosmic-nav.scrolled { background: rgba(2, 2, 15, 0.97); }

nav.cosmic-nav .nav-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 1.7rem;
  color: var(--gold) !important;
  text-decoration: none;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
nav.cosmic-nav .nav-logo img {
  height: 32px;
  width: auto;
  border-radius: 6px;
}

nav.cosmic-nav .nav-links {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}
nav.cosmic-nav .nav-links a {
  color: var(--moonlight);
  text-decoration: none;
  font-size: 0.80rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}
nav.cosmic-nav .nav-links a:hover {
  color: var(--gold);
  background: rgba(240, 192, 96, 0.10);
  text-decoration: none;
}
nav.cosmic-nav .nav-links a.active {
  color: var(--gold);
}

nav.cosmic-nav .nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
}
nav.cosmic-nav .nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--moonlight);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  nav.cosmic-nav .nav-hamburger { display: flex; }
  nav.cosmic-nav .nav-links {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    background: rgba(2, 2, 15, 0.97);
    backdrop-filter: blur(14px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(200, 184, 232, 0.10);
    flex-wrap: nowrap;
  }
  nav.cosmic-nav .nav-links.open { display: flex; }
  nav.cosmic-nav .nav-links a { padding: 10px 12px; font-size: 0.88rem; }
}

/* ── 6. Page Wrapper ───────────────────────────────────────── */
.cosmic-page-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 60px) clamp(16px, 4vw, 40px) clamp(48px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 40px);
}

/* ── 7. Cosmic Cards ───────────────────────────────────────── */
.cosmic-card {
  background: rgba(13, 13, 53, 0.75);
  border: 1px solid rgba(200, 184, 232, 0.14);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 48px);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.cosmic-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(74, 26, 140, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

/* ── 8. Section Labels & Titles ────────────────────────────── */
.section-label-cosmic {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stardust);
  margin-bottom: 0.9rem;
  font-family: 'Raleway', sans-serif;
}
.section-label-cosmic::before,
.section-label-cosmic::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(123, 94, 167, 0.4), transparent);
}

.section-title-cosmic {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.6rem;
  color: #ffffff;
}

.section-desc-cosmic {
  text-align: center;
  color: var(--moonlight);
  opacity: 0.78;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 0.97rem;
}

/* ── 9. Buttons ────────────────────────────────────────────── */
.btn-cosmic,
.btn-cosmic-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--cosmic-purple), #2a0a6a);
  border: 1px solid rgba(200, 184, 232, 0.3);
  color: #ffffff !important;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 8px 28px rgba(74, 26, 140, 0.45);
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
}
.btn-cosmic:hover,
.btn-cosmic-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(74, 26, 140, 0.65);
  color: var(--gold-light) !important;
  border-color: var(--gold);
  text-decoration: none !important;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--gold), #d4960a);
  border: none;
  color: var(--deep-space) !important;
  padding: 0.8rem 2.2rem;
  border-radius: 50px;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 8px 28px rgba(240, 192, 96, 0.35);
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
}
.btn-gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(240, 192, 96, 0.55);
  text-decoration: none !important;
}

/* ── 10. Form Controls (dark, cosmic) ──────────────────────── */
.cosmic-input,
.cosmic-select,
.cosmic-textarea {
  background: rgba(7, 7, 32, 0.80) !important;
  border: 1px solid rgba(200, 184, 232, 0.22) !important;
  border-radius: 12px !important;
  color: var(--silver) !important;
  padding: 11px 16px !important;
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.cosmic-input:focus,
.cosmic-select:focus,
.cosmic-textarea:focus {
  outline: none !important;
  border-color: var(--stardust) !important;
  box-shadow: 0 0 0 3px rgba(123, 94, 167, 0.2) !important;
}
.cosmic-input::placeholder,
.cosmic-textarea::placeholder { color: rgba(200, 184, 232, 0.45); }

label.cosmic-label {
  display: block;
  font-size: 0.84rem;
  color: var(--stardust);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── 11. Bootstrap Deep Overrides ──────────────────────────── */
/* Applied on pages that load Bootstrap */

.navbar { background: rgba(2, 2, 15, 0.92) !important; border-bottom: 1px solid rgba(200,184,232,0.12) !important; }
.navbar-light .navbar-brand,
.navbar-dark .navbar-brand { color: var(--gold) !important; }
.navbar-light .navbar-nav .nav-link,
.navbar-dark  .navbar-nav .nav-link { color: var(--moonlight) !important; }
.navbar-light .navbar-nav .nav-link:hover,
.navbar-dark  .navbar-nav .nav-link:hover { color: var(--gold) !important; }

/* Containers & Cards */
.container,
.container-fluid { color: var(--silver); }

.card {
  background: rgba(13, 13, 53, 0.78) !important;
  border: 1px solid rgba(200, 184, 232, 0.14) !important;
  border-radius: 18px !important;
  color: var(--silver) !important;
  backdrop-filter: blur(8px);
}
.card-body { background: transparent !important; }
.card-shadow { box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important; }

/* Form controls */
.form-control,
.form-select {
  background: rgba(7, 7, 32, 0.82) !important;
  border: 1px solid rgba(200, 184, 232, 0.22) !important;
  border-radius: 10px !important;
  color: var(--silver) !important;
  font-family: 'Raleway', sans-serif;
}
.form-control::placeholder { color: rgba(200, 184, 232, 0.4) !important; }
.form-control:focus,
.form-select:focus {
  background: rgba(7, 7, 32, 0.95) !important;
  border-color: var(--stardust) !important;
  box-shadow: 0 0 0 3px rgba(123, 94, 167, 0.22) !important;
  color: #fff !important;
}
.form-select option {
  background: var(--midnight);
  color: var(--silver);
}

.form-label { color: var(--moonlight) !important; font-size: 0.88rem; }

.form-text,
.text-muted { color: var(--stardust) !important; }

/* Form check */
.form-check-input {
  background-color: rgba(7,7,32,0.8) !important;
  border-color: rgba(200,184,232,0.3) !important;
}
.form-check-input:checked {
  background-color: var(--cosmic-purple) !important;
  border-color: var(--stardust) !important;
}
.form-check-label { color: var(--moonlight) !important; }

/* Invalid feedback */
.invalid-feedback { color: var(--danger-red) !important; }

/* Alerts */
.alert-success {
  background: rgba(78, 204, 163, 0.15) !important;
  border-color: rgba(78, 204, 163, 0.35) !important;
  color: var(--emerald) !important;
}
.alert-danger {
  background: rgba(255, 107, 107, 0.15) !important;
  border-color: rgba(255, 107, 107, 0.3) !important;
  color: var(--danger-red) !important;
}
.alert-info {
  background: rgba(110, 231, 247, 0.12) !important;
  border-color: rgba(110, 231, 247, 0.3) !important;
  color: var(--accent) !important;
}

/* Headings in Bootstrap context */
h1, h2, h3, h4, h5, h6 { color: #ffffff; }
.text-dark { color: var(--silver) !important; }
.text-center h1, .text-center h2 { color: #ffffff; }
p.lead, p.mb-0 { color: var(--moonlight); }

/* Bootstrap buttons — restyle to cosmic */
.btn-primary {
  background: linear-gradient(135deg, var(--cosmic-purple), #2a0a6a) !important;
  border: 1px solid rgba(200, 184, 232, 0.3) !important;
  border-radius: 50px !important;
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.8rem !important;
  box-shadow: 0 8px 28px rgba(74,26,140,0.4) !important;
  transition: all 0.3s !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #5a1aac, #3a0a8a) !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(74,26,140,0.6) !important;
  color: var(--gold-light) !important;
}
.btn-success {
  background: linear-gradient(135deg, #0a6a2a, #1a8a4a) !important;
  border: 1px solid rgba(78, 204, 163, 0.3) !important;
  border-radius: 50px !important;
  color: #fff !important;
  font-weight: 600;
}
.btn-outline-primary {
  background: transparent !important;
  border: 1px solid rgba(200, 184, 232, 0.4) !important;
  border-radius: 50px !important;
  color: var(--moonlight) !important;
  font-weight: 600;
}
.btn-outline-primary:hover {
  background: rgba(74, 26, 140, 0.3) !important;
  border-color: var(--stardust) !important;
  color: #fff !important;
}

/* Bootstrap navbar-brand */
.navbar-brand img { border-radius: 6px; }

/* Radio buttons in forms */
.form-check-input[type="radio"]:checked {
  background-color: var(--cosmic-purple) !important;
  border-color: var(--stardust) !important;
}

/* Text colors override */
.text-muted { color: var(--stardust) !important; }
.text-danger { color: var(--danger-red) !important; }
.text-success { color: var(--emerald) !important; }

/* ── 12. Cosmic Footer ─────────────────────────────────────── */
.cosmic-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(200, 184, 232, 0.10);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  background: rgba(2, 2, 15, 0.6);
  width: 100%;
}
.cosmic-footer .footer-logo {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}
.cosmic-footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-bottom: 1.2rem;
  list-style: none;
  padding: 0;
}
.cosmic-footer .footer-links a,
.cosmic-footer a {
  color: var(--stardust);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.cosmic-footer .footer-links a:hover,
.cosmic-footer a:hover { color: var(--gold); text-decoration: none; }
.cosmic-footer .footer-copy {
  font-size: 0.75rem;
  color: var(--stardust);
  opacity: 0.55;
}

/* site-footer also styled dark (index.html) */
.site-footer {
  background: rgba(2, 2, 15, 0.85) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(200, 184, 232, 0.10);
  padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 48px);
  width: 100%;
}
.site-footer .footer-links a { color: var(--stardust) !important; }
.site-footer .footer-links a:hover { color: var(--gold) !important; }
.site-footer .footer-copy { color: rgba(200, 184, 232, 0.35) !important; }

/* ── 13. Misc Utilities ────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.cosmic-divider {
  text-align: center;
  padding: 0.6rem 0;
  color: var(--stardust);
  opacity: 0.4;
  font-size: 1.1rem;
  letter-spacing: 0.8rem;
}

pre {
  background: rgba(2, 2, 15, 0.85) !important;
  border: 1px solid rgba(200, 184, 232, 0.14) !important;
  border-radius: 12px;
  padding: 1.2rem;
  color: var(--silver);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background: var(--cosmic-purple);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  z-index: 9999;
  transition: left 0.3s;
}
.skip-link:focus { left: 1rem; }

/* ── 14. Animations ────────────────────────────────────────── */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 192, 96, 0.2); }
  50%       { box-shadow: 0 0 18px 4px rgba(240, 192, 96, 0.28); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes floatPlanet {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── 15. Responsive ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
