@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
  font-family: 'Iosevka Aile';
  font-display: swap;
  font-weight: 400;
  font-style: normal;
  src: url('https://raw.githubusercontent.com/TechnoSparks/iosevka-aile-webfont/main/woff2/iosevka-aile-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Iosevka Aile';
  font-display: swap;
  font-weight: 400;
  font-style: italic;
  src: url('https://raw.githubusercontent.com/TechnoSparks/iosevka-aile-webfont/main/woff2/iosevka-aile-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Iosevka Aile';
  font-display: swap;
  font-weight: 700;
  font-style: normal;
  src: url('https://raw.githubusercontent.com/TechnoSparks/iosevka-aile-webfont/main/woff2/iosevka-aile-bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Iosevka Aile';
  font-display: swap;
  font-weight: 700;
  font-style: italic;
  src: url('https://raw.githubusercontent.com/TechnoSparks/iosevka-aile-webfont/main/woff2/iosevka-aile-bolditalic.woff2') format('woff2');
}

:root {
  --bg: #ffffff;
  --bg-secondary: #fafafa;
  --text: #0a0a0a;
  --text-secondary: #666666;
  --border: #eaeaea;
  --card: #ffffff;
  --glow: rgba(0, 0, 0, 0.02);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Iosevka Aile', 'Iosevka', 'JetBrains Mono', 'Fira Code', monospace;
  --font-serif: 'Playfair Display', 'Georgia', serif;
}

.dark {
  --bg: #000000;
  --bg-secondary: #0a0a0a;
  --text: #ededed;
  --text-secondary: #666666;
  --border: #1a1a1a;
  --card: #0a0a0a;
  --glow: rgba(255, 255, 255, 0.02);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====================== */
/*  3D BADGE COMPONENT    */
/* ====================== */

.badge-3d-card {
  transform-style: preserve-3d;
  cursor: grab;
  will-change: transform;
}

.badge-3d-card:active { cursor: grabbing; }

.badge-3d-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(165deg, #0d0d0d 0%, #050505 50%, #0a0a0a 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 4px 20px rgba(0,0,0,0.5),
    0 8px 40px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04);
  transform: translateZ(0);
}

.dark .badge-3d-body {
  background: linear-gradient(165deg, #0d0d0d 0%, #050505 50%, #0a0a0a 100%);
}

:root:not(.dark) .badge-3d-body {
  background: linear-gradient(165deg, #fafafa 0%, #f0f0f0 50%, #f5f5f5 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 4px 20px rgba(0,0,0,0.08),
    0 8px 40px rgba(0,0,0,0.06);
}

.badge-holo-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: background 0.15s ease-out;
  pointer-events: none;
  mix-blend-mode: screen;
}

.badge-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: background 0.1s ease-out;
  mix-blend-mode: overlay;
}

.badge-accent-bar {
  position: relative;
  z-index: 3;
  height: 3px;
  width: 100%;
}

.badge-accent-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(8px);
  opacity: 0.5;
}

.badge-lanyard-hole {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 14px;
  border-radius: 0 0 14px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  z-index: 5;
}

.badge-lanyard-hole-inner {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 8px;
  border-radius: 0 0 8px 8px;
  background: var(--bg);
}

.badge-content {
  position: relative;
  z-index: 4;
  height: calc(100% - 3px);
  display: flex;
  flex-direction: column;
}

.badge-separator {
  border-top: 1px dashed;
  position: relative;
}

.badge-separator::before,
.badge-separator::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
}

.badge-separator::before { left: -20px; }
.badge-separator::after { right: -20px; }

.badge-tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.badge-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 5;
  pointer-events: none;
}

.badge-corner-tl {
  top: 8px;
  left: 8px;
  border-top: 1px solid;
  border-left: 1px solid;
  border-radius: 4px 0 0 0;
}

.badge-corner-br {
  bottom: 8px;
  right: 8px;
  border-bottom: 1px solid;
  border-right: 1px solid;
  border-radius: 0 0 4px 0;
}

/* ====================== */
/*  GENERAL UI            */
/* ====================== */

.badge-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
  position: relative;
}

.badge-card:hover {
  border-color: var(--text-secondary);
}

.badge-shimmer {
  position: relative;
  overflow: hidden;
}

.badge-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

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

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: none;
  font-weight: 500;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }

.input-fancy {
  transition: all 0.15s;
  font-family: var(--font-sans);
}

.input-fancy:focus {
  border-color: var(--text-secondary);
  box-shadow: 0 0 0 1px var(--text-secondary);
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

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

.animate-fade-up {
  animation: fadeUp 0.3s ease-out forwards;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

::selection {
  background: rgba(255, 255, 255, 0.15);
}

:root:not(.dark) ::selection {
  background: rgba(0, 0, 0, 0.1);
}
