/* ============================================
   EduMirror Gallery — Premium Visual System
   ============================================ */

/* ── CSS Variables ── */
:root {
  --color-primary: #4F46E5;
  --color-primary-light: #7C3AED;
  --color-bg: #F8FAFC;
  --color-card: #FFFFFF;
  --color-text-dark: #1E293B;
  --color-text-medium: #64748B;
  --color-text-light: #94A3B8;
  --color-accent: #6366F1;
  --cat-fundamentals: #3B82F6;
  --cat-advanced: #8B5CF6;
  --cat-showcase: #10B981;
  --cat-principles: #F59E0B;
  --radius: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ── Base ── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Hero Section ── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.hero-glow-1 {
  width: 400px;
  height: 400px;
  background: #4F46E5;
  top: -100px;
  right: -80px;
}

.hero-glow-2 {
  width: 300px;
  height: 300px;
  background: #7C3AED;
  bottom: -80px;
  left: -60px;
}

/* ── Text Gradient ── */
.text-gradient {
  background: linear-gradient(90deg, #818cf8, #c084fc, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glass Morphism ── */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Gradient Border Cards ── */
.card-gradient-border {
  position: relative;
  background: var(--color-card);
  border-radius: var(--radius);
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease;
}

.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--border-color, #e2e8f0), var(--border-color-2, #f1f5f9));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
  transition: background 0.35s ease, padding 0.35s ease;
}

.card-gradient-border:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-xl);
}

.card-gradient-border:hover::before {
  padding: 2px;
  background: linear-gradient(135deg, var(--border-color-hover, #4F46E5), var(--border-color-hover-2, #7C3AED));
}

/* ── Category Badge Colors ── */
.cat-fundamentals { --border-color: #bfdbfe; --border-color-2: #eff6ff; --border-color-hover: #3B82F6; --border-color-hover-2: #60a5fa; }
.cat-advanced     { --border-color: #ddd6fe; --border-color-2: #f5f3ff; --border-color-hover: #8B5CF6; --border-color-hover-2: #a78bfa; }
.cat-showcase     { --border-color: #a7f3d0; --border-color-2: #ecfdf5; --border-color-hover: #10B981; --border-color-hover-2: #34d399; }
.cat-principles   { --border-color: #fde68a; --border-color-2: #fffbeb; --border-color-hover: #F59E0B; --border-color-hover-2: #fbbf24; }

/* ── Category Chip ── */
.cat-chip {
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  border: 1px solid #e2e8f0;
}

.cat-chip:hover:not(.cat-chip-active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cat-chip-active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

/* ── Language Toggle ── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  background: rgba(255,255,255,0.2);
}

.lang-toggle-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.lang-toggle-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  cursor: pointer;
  transition: background 0.15s ease;
}

.lang-option:hover {
  background: #f1f5f9;
}

.lang-option.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Search Bar ── */
.search-glass {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  transition: all 0.25s ease;
}

.search-glass:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

/* ── Card Entrance Animations ── */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-animate {
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* stagger delays applied via inline style from JS */

/* ── Tag Pill ── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f1f5f9;
  color: var(--color-text-medium);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background: #e2e8f0;
  color: var(--color-text-dark);
}

/* ── View Demo Link ── */
.view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary);
  transition: gap 0.25s ease, color 0.25s ease;
}

.view-link:hover {
  gap: 10px;
  color: var(--color-primary-light);
}

.view-link svg {
  transition: transform 0.25s ease;
}

.view-link:hover svg {
  transform: translateX(3px);
}

/* ── Empty State ── */
.empty-illustration {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}

.empty-illustration::before,
.empty-illustration::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
  opacity: 0.6;
}

.empty-illustration::before {
  width: 80px;
  height: 80px;
  top: -20px;
  left: -30px;
}

.empty-illustration::after {
  width: 60px;
  height: 60px;
  bottom: -15px;
  right: -25px;
}

/* ── Footer ── */
.footer-glow {
  position: relative;
}

.footer-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── Responsive utilities ── */
@media (max-width: 639px) {
  .hero-glow-1,
  .hero-glow-2 {
    opacity: 0.2;
    filter: blur(60px);
  }
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

