/* === base.css — LinguaSpace 2025 — Flask + Mobile Optimized === */

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === VARIABLES === */
:root {
  --accent: #4db8ff;
  --accent-strong: #2aa6ff;
  --dark-bg: #071529;
  --dark-bg2: #0a1e36;
  --muted-text: rgba(200,210,225,0.85);
  --nav-height: 68px;
}

/* === GLOBAL LAYOUT === */
html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--dark-bg);
  color: #e8f4ff;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* === BACKGROUND GRADIENT === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 25% 35%, var(--dark-bg) 0%, var(--dark-bg2) 45%, #120f2e 80%, #1a0023 100%);
  z-index: -1;
  will-change: opacity;
}
body.landing-page::before {
  background: url("../img/bg2.jpg") center/cover no-repeat;
  filter: brightness(0.9);
}

/* === SAFE AREA === */
@supports (padding: max(0px)) {
  body { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: linear-gradient(90deg, #020617 0%, #071b3b 50%, #0a234d 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  z-index: 1200;
}
.navbar.nav-scrolled {
  background: rgba(3,10,22,0.92);
  height: 60px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo img {
  width: 30px;
  height: 30px;
}
.logo-text {
  color: var(--accent);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(77,184,255,0.35);
}

/* === NAV LINKS (Desktop) === */
.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 0.93rem;
}
.nav-links a {
  color: #e8f4ff;
  text-decoration: none;
  padding: 3px 0;
  position: relative;
  transition: color 0.25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* === BURGER === */
.burger {
  display: none;
  width: 32px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  z-index: 1301;
}
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform .4s cubic-bezier(.77,.2,.05,1.0), opacity .3s, background .3s;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 12px; }
.burger span:nth-child(3) { bottom: 0; }

.burger.active span:nth-child(1) {
  transform: translateY(12px) rotate(45deg);
  background: var(--accent);
}
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) {
  transform: translateY(-12px) rotate(-45deg);
  background: var(--accent);
}

/* === SLIDE-IN MOBILE MENU === */
@media (max-width: 768px) {
  .burger { display: block; }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 270px;
    height: 100vh;
    background: rgba(3,8,18,0.96);
    flex-direction: column;
    justify-content: flex-start;
    padding: 90px 24px;
    transition: right .35s cubic-bezier(.2,.9,.2,1);
    z-index: 1250;
  }
  .nav-links.open { right: 0; }

  .nav-links a {
    font-size: 1.05rem;
    width: 100%;
    padding: 8px 0;
  }
}

/* === OVERLAY === */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1240;
}
.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* === MAIN === */
main {
  padding: calc(var(--nav-height) + 20px) 16px 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* === CARD === */
.card {
  background: rgba(0,0,0,0.55);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
}

/* === ICON COLOR === */
.icon, .like-btn img, .comment-btn img, .share-btn img {
  filter: invert(41%) sepia(52%) saturate(5104%) hue-rotate(184deg) brightness(92%) contrast(92%);
  transition: filter .18s ease, transform .12s ease;
}
.icon:active, .like-btn:active img, .comment-btn:active img, .share-btn:active img {
  filter: invert(41%) sepia(52%) saturate(5104%) hue-rotate(184deg) brightness(120%) contrast(100%);
  transform: scale(0.94);
}

/* === PAGE FADE === */
.page-fade {
  position: fixed;
  inset: 0;
  background: #020617;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.page-fade.fade-out { opacity: 0; }

/* === TAP FIX === */
a, button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
:focus-visible {
  outline: 3px solid rgba(77,184,255,0.15);
  border-radius: 6px;
}

/* === RESPONSIVE === */
@media (min-width: 1024px) {
  .container { max-width: 1200px; padding: 0 24px; margin: 0 auto; }
  main { padding: 110px 24px 120px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
