/**
 * Hexagon theme elements - Dark theme with equilateral hexagons
 */

/* Equilateral hexagon shape using clip-path
   For equilateral: height = width * 1.1547 (or width = height * 0.866)
   Points: top-center, top-right, bottom-right, bottom-center, bottom-left, top-left */
.hexagon {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Subtle hexagonal card shape */
.hex-card {
  clip-path: polygon(3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
}

/* Hexagon badge */
.hex-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 55px; /* Equilateral ratio */
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  color: var(--color-text-inverse);
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  box-shadow: var(--shadow-glow);
}

.hex-badge--sm {
  width: 32px;
  height: 37px; /* Equilateral ratio */
  font-size: var(--text-xs);
}

.hex-badge--lg {
  width: 64px;
  height: 74px; /* Equilateral ratio */
  font-size: var(--text-xl);
}

/* Hexagon rank badge - equilateral */
.rank-hex {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 46px; /* Equilateral ratio: 40 * 1.1547 ≈ 46 */
}

.rank-hex::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.rank-hex__number {
  position: relative;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  text-shadow: 0 0 8px var(--color-primary-alpha-20);
}

/* Honeycomb background pattern - dark theme */
.honeycomb-bg {
  position: relative;
  background-color: var(--color-bg);
}

.honeycomb-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23e91e8c' fill-opacity='0.03'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Hexagon icon */
.hex-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.hex-icon svg {
  width: 100%;
  height: 100%;
}

/* Header hexagon decoration */
.header-hex {
  position: absolute;
  opacity: 0.1;
}

.header-hex--1 {
  top: -20px;
  right: 10%;
  width: 80px;
  height: 92px; /* Equilateral */
}

.header-hex--2 {
  bottom: -30px;
  right: 25%;
  width: 60px;
  height: 69px; /* Equilateral */
}

/* Login page hexagon decorations - dark theme */
.login-hex {
  position: absolute;
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-tertiary) 100%);
  border: 1px solid var(--color-border);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  pointer-events: none;
}

.login-hex--1 {
  width: 200px;
  height: 231px; /* Equilateral */
  top: 10%;
  left: 5%;
  opacity: 0.6;
}

.login-hex--2 {
  width: 150px;
  height: 173px; /* Equilateral */
  top: 60%;
  left: 15%;
  opacity: 0.4;
}

.login-hex--3 {
  width: 100px;
  height: 115px; /* Equilateral */
  top: 20%;
  right: 10%;
  opacity: 0.5;
}

.login-hex--4 {
  width: 180px;
  height: 208px; /* Equilateral */
  bottom: 10%;
  right: 5%;
  opacity: 0.6;
}

.login-hex--5 {
  width: 80px;
  height: 92px; /* Equilateral */
  bottom: 30%;
  right: 20%;
  opacity: 0.3;
}

/* Category hexagon badge */
.category-hex {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-primary-light);
}

.category-hex::before {
  content: '';
  display: block;
  width: 12px;
  height: 14px; /* Equilateral */
  background-color: var(--color-primary);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
  box-shadow: 0 0 4px var(--color-primary);
}

.category-hex__id {
  font-family: monospace;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--color-neon);
  background-color: var(--color-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-right: var(--space-1);
}

/* Animated hexagon loader */
.hex-loader {
  position: relative;
  width: 60px;
  height: 69px; /* Equilateral */
}

.hex-loader__cell {
  position: absolute;
  width: 20px;
  height: 23px; /* Equilateral */
  background-color: var(--color-primary);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: hexPulse 1.5s ease-in-out infinite;
}

.hex-loader__cell:nth-child(1) { top: 0; left: 20px; animation-delay: 0s; }
.hex-loader__cell:nth-child(2) { top: 12px; left: 35px; animation-delay: 0.1s; }
.hex-loader__cell:nth-child(3) { top: 35px; left: 35px; animation-delay: 0.2s; }
.hex-loader__cell:nth-child(4) { top: 46px; left: 20px; animation-delay: 0.3s; }
.hex-loader__cell:nth-child(5) { top: 35px; left: 5px; animation-delay: 0.4s; }
.hex-loader__cell:nth-child(6) { top: 12px; left: 5px; animation-delay: 0.5s; }
.hex-loader__cell:nth-child(7) { top: 23px; left: 20px; animation-delay: 0.3s; }

@keyframes hexPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--color-primary);
  }
}

/* Large domain detail rank hexagon */
.rank-hex--lg {
  width: 64px;
  height: 74px; /* Equilateral */
}

.rank-hex--lg .rank-hex__number {
  font-size: var(--text-2xl);
}
