@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap");

/* ========== MASTER TOGAN DESIGN SYSTEM — CSS VARIABLES ========== */
:root {
  /* ── COLOR PALETTE ── */
  --color-primary-bg: #0a0a0a;
  --color-secondary-bg: #111;
  --color-tertiary-bg: #222;

  --color-accent-blue-dark: #5b8fff;
  --color-accent-blue-medium: #6b9eff;
  --color-accent-purple: #b393ff;
  --color-accent-light: #f8f6ff;
  --color-accent-subtle: #f4f8ff;

  /* ── GRADIENTS ── */
  --gradient-primary-text: linear-gradient(90deg, #5b8fff, #f8f6ff);
  --gradient-secondary-text: linear-gradient(90deg, #6b9eff, #b393ff);
  --gradient-tertiary-text: linear-gradient(90deg, #f4f8ff, #b393ff);
  --gradient-bg-global: linear-gradient(
    135deg,
    #0a0e27 0%,
    #1a1f3a 50%,
    #0f1428 100%
  );
  --gradient-card-light: linear-gradient(
    135deg,
    rgba(107, 158, 255, 0.1),
    rgba(163, 128, 255, 0.08)
  );
  --gradient-card-active: linear-gradient(
    135deg,
    rgba(107, 158, 255, 0.15),
    rgba(163, 128, 255, 0.12)
  );
  --gradient-card-intense: linear-gradient(
    135deg,
    rgba(107, 158, 255, 0.2),
    rgba(163, 128, 255, 0.15)
  );

  /* ── TYPOGRAPHY ── */
  --font-family-primary: "Manrope", "Gellix", sans-serif;
  --font-weight-regular: 400;
  --font-weight-bold: 700;

  --font-size-xs: 10px;
  --font-size-sm: 11px;
  --font-size-base: 12px;
  --font-size-md: 13px;
  --font-size-lg: 15px;
  --font-size-xl: 17px;
  --font-size-2xl: 18px;
  --font-size-3xl: 20px;
  --font-size-4xl: 24px;
  --font-size-5xl: 40px;
  --font-size-6xl: 72px;
  --font-size-7xl: 96px;

  /* ── LETTER SPACING ── */
  --letter-spacing-tight: -10px;
  --letter-spacing-compact: -0.9px;
  --letter-spacing-semi-compact: -0.7px;
  --letter-spacing-normal: -0.5px;
  --letter-spacing-loose: 0.2px;
  --letter-spacing-looser: 0.3px;

  /* ── SPACING ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 30px;

  --nav-height: 80px;

  /* ── BORDER RADIUS ── */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-3xl: 20px;
  --radius-4xl: 24px;
  --radius-5xl: 28px;

  /* ── BORDERS ── */
  --border-color-light: rgba(107, 158, 255, 0.3);
  --border-color-medium: rgba(107, 158, 255, 0.5);
  --border-color-dark: rgba(107, 158, 255, 0.8);
  --border-width: 1.5px;

  /* ── TRANSITIONS ── */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;

  /* ── OPACITY ── */
  --opacity-inactive: 0.5;
  --opacity-hover: 0.6;
  --opacity-active: 0.8;
  --opacity-full: 1;
  --opacity-icon-light: 0.25;
  --opacity-icon-medium: 0.5;

  /* ── SHADOWS ── */
  --shadow-glow-sm: 0 0 12px rgba(107, 158, 255, 0.2);
  --shadow-glow-md: 0 0 16px rgba(107, 158, 255, 0.2);
  --shadow-glow-lg: 0 0 20px rgba(107, 158, 255, 0.25);

  /* ── GLASS ── */
  --glass-bg-light: rgba(255, 255, 255, 0.08);
  --glass-bg-medium: rgba(255, 255, 255, 0.12);
  --glass-blur-sm: blur(4px);
  --glass-blur-md: blur(6px);
  --glass-blur-lg: blur(8px);
  --glass-blur-xl: blur(12px);
}

/* ========== UTILITY CLASSES ========== */

.gradient-text-primary {
  background: var(--gradient-primary-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-secondary {
  background: var(--gradient-secondary-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-tertiary {
  background: var(--gradient-tertiary-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: linear-gradient(
    135deg,
    var(--glass-bg-light),
    rgba(163, 128, 255, 0.08)
  );
  backdrop-filter: var(--glass-blur-md);
  border: var(--border-width) solid var(--border-color-light);
  border-radius: var(--radius-xl);
}

.glass-card:active {
  border-color: var(--border-color-dark);
  background: linear-gradient(
    135deg,
    var(--glass-bg-medium),
    rgba(163, 128, 255, 0.12)
  );
  box-shadow: var(--shadow-glow-md);
  transform: scale(0.98);
}

.interactive-btn {
  cursor: pointer;
  transition: var(--transition-fast);
  border: var(--border-width) solid var(--border-color-light);
  border-radius: var(--radius-lg);
}

.interactive-btn:active {
  border-color: var(--border-color-dark);
  box-shadow: var(--shadow-glow-sm);
  transform: scale(0.95);
}

.title-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: -12px;
}

.title-large {
  font-size: var(--font-size-7xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 0.95;
  display: inline-block;
  white-space: nowrap;
  padding-right: var(--space-3xl);
}

.title-medium {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 0.95;
  display: inline-block;
  white-space: nowrap;
  padding-right: var(--space-3xl);
}

.title-small {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-compact);
}

.scroll-wrapper {
  padding: var(--space-lg) var(--space-xl) var(--nav-height);
  overflow-y: auto;
  overflow-x: hidden;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-column-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ========== ANIMATION KEYFRAMES ========== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Page enter — applied by showPage() on every navigation */
/* .page-fade-in {
  animation: fadeIn 0.18s ease-out both;
} */

/* ========== COMPONENT SNIPPETS ========== */

.search-input {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(0, 9, 26, 0.15);
  border: var(--border-width) solid var(--border-color-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  backdrop-filter: var(--glass-blur-lg);
  transition: var(--transition-fast);
}

.search-input:focus-within {
  border-color: var(--border-color-dark);
  background: var(--glass-bg-medium);
  box-shadow: var(--shadow-glow-sm);
}

.search-icon {
  width: 16px;
  height: 16px;
  opacity: var(--opacity-icon-light);
  flex-shrink: 0;
}

.search-input input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--font-size-xl);
  color: var(--color-accent-light);
  font-family: var(--font-family-primary);
  letter-spacing: var(--letter-spacing-normal);
}

.search-input input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.expandable-card {
  cursor: pointer;
  transition: var(--transition-fast);
}

.expandable-content {
  display: none;
  animation: slideDown 0.3s ease;
}

.expandable-card.expanded .expandable-content {
  display: block;
}

.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .grid-3-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================================= */

.scroll-reveal-item {
  --scroll-reveal-opacity: 0.96;
  --scroll-reveal-offset: 0px;
  --scroll-reveal-scale: 1;
  opacity: var(--scroll-reveal-opacity);
  transform: translate3d(0, var(--scroll-reveal-offset), 0)
    scale(var(--scroll-reveal-scale));
  transform-origin: center top;
  transition:
    opacity 0.18s ease-out,
    transform 0.24s ease-out;
  will-change: opacity, transform;
}

.scroll-reveal-item.scroll-reveal-visible {
  opacity: var(--scroll-reveal-opacity);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

button,
a,
img,
div,
span,
label {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html,
body {
  font-family: var(--font-family-primary);
  width: 100%;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: "Gellix", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent GPU-compositing flicker on touch interactions */
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Layout */
.mobile-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: var(--gradient-bg-global);
}

.header {
  flex: 0 0 auto;
  background: rgba(10, 14, 39, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 0.5px solid rgba(107, 158, 255, 0.2);
  padding: 14px 0;
}

.main {
  flex: 1;
  position: relative;
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: none;
}

.main::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 72px;
  margin-top: -72px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(10, 14, 39, 0.08),
    rgba(10, 14, 39, 0.04) 38%,
    transparent 100%
  );
  filter: blur(14px);
  z-index: 1;
}

.footer {
  flex: 0 0 auto;
  background: rgba(10, 14, 39, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-top: 0.5px solid rgba(107, 158, 255, 0.2);
  padding: 7px 0;
}

.header-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-profile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  cursor: pointer;
}

.header-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #0a0e27;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 7px;
}

.header-title {
  font-size: 6px;
  font-weight: 500;
  letter-spacing: 4px;
  background: rgba(255, 255, 255, 0.8);
  color: rgba(255, 255, 255, 0.8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
}

.header-menu-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.75;
  display: block;
}

.header-menu img:hover {
  opacity: 1;
}

.header-noti-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-nav-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd700;
  border: 1.5px solid #070b1e;
  display: none;
  pointer-events: none;
}

.footer-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 5px 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.2s;
}

.nav-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.45;
  filter: brightness(1.1) saturate(0.7);
  transition:
    opacity 0.2s,
    filter 0.2s;
}

.nav-label {
  font-size: 7px;
  color: #ccc;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.nav-item.active .nav-icon {
  opacity: 1;
  filter: brightness(1.3) saturate(1.2);
}

.nav-item.active .nav-label {
  color: #fff;
  font-weight: 500;
}

/* CTA button (shared) */
.panel-cta {
  width: 100%;
  background: #000;
  border: none;
  border-radius: 5px;
  padding: 16px 20px;
  display: block;
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.5px;
  font-family: "Gellix", sans-serif;
  transition: opacity 0.2s;
  line-height: 1.4;
}

.panel-cta span {
  display: inline;
}

.panel-cta:active {
  opacity: 0.8;
}

.panel-cta-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* ── Tablet (768px+) ── */
@media (min-width: 768px) {
  .header-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
  }

  .footer-wrapper {
    max-width: 900px;
    margin: 0 auto;
  }

  .header-menu-icon {
    width: 18px;
    height: 18px;
  }

  .header-profile img {
    width: 20px;
    height: 20px;
  }

  .header-title {
    font-size: 8px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .nav-label {
    font-size: 8px;
  }
}

/* ── Desktop (1024px+) ── */
@media (min-width: 1024px) {
  /* Sidebar navigation — footer moves to left rail */
  .footer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border-top: none;
    border-right: 0.5px solid rgba(107, 158, 255, 0.15);
    border-bottom: none;
    padding: 80px 0 24px;
    z-index: 5;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .footer-wrapper {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    padding: 0;
    max-width: none;
    margin: 0;
    width: 100%;
  }

  .nav-item {
    width: 100%;
    flex-direction: row;
    gap: 14px;
    padding: 13px 24px;
    justify-content: flex-start;
    border-radius: 0;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.5;
  }

  .nav-item.active .nav-icon {
    opacity: 1;
  }

  .nav-label {
    font-size: 13px;
    letter-spacing: -0.3px;
  }

  /* Push all content to the right of the sidebar */
  .mobile-layout {
    padding-left: 220px;
  }

  .header-wrapper {
    max-width: none;
    padding: 0 40px;
    margin: 0;
  }

  .header-title {
    font-size: 9px;
    letter-spacing: 5px;
  }
}
