/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body:not(.is-admin) .admin-only {
  display: none !important;
}

/* OGame UI Rework Styles */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --cyan-glow: rgba(6, 182, 212, 0.8);
  --cyan-glow-soft: rgba(6, 182, 212, 0.3);
  --slate-950: rgb(2, 6, 23);
  --slate-900: rgb(15, 23, 42);
  --slate-800: rgb(30, 41, 59);
  --slate-700: rgb(51, 65, 85);
  --slate-600: rgb(71, 85, 105);
  --slate-500: rgb(100, 116, 139);
  --slate-400: rgb(148, 163, 184);
  --slate-300: rgb(203, 213, 225);
  --slate-200: rgb(226, 232, 240);
  --slate-100: rgb(241, 245, 249);
  --cyan-400: rgb(34, 211, 238);
  --cyan-500: rgb(6, 182, 212);
  --cyan-600: rgb(8, 145, 178);
  --blue-400: rgb(96, 165, 250);
  --blue-500: rgb(59, 130, 246);
}

/* ============================================
   Clip Path Utilities
   ============================================ */
.clip-nav-panel {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 10px));
}

.clip-sidebar-left {
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%);
}

.clip-sidebar-right {
  clip-path: polygon(15px 0, 100% 0, 100% 100%, 0 100%, 0 15px);
}

.clip-card {
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.clip-card-sm {
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.clip-button {
  clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%);
}

/* ============================================
   Glow Effects
   ============================================ */
.glow-text-cyan {
  text-shadow: 0 0 20px var(--cyan-glow-soft), 0 0 40px rgba(6, 182, 212, 0.2);
}

.glow-text-cyan-strong {
  text-shadow: 0 0 10px var(--cyan-glow), 0 0 20px var(--cyan-glow-soft);
}

.glow-icon-cyan {
  filter: drop-shadow(0 0 4px var(--cyan-400));
}

.glow-icon-cyan-strong {
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}

/* ============================================
   Tooltips
   ============================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: rgba(148, 163, 184, 1);
  font-size: 0.65rem;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  letter-spacing: 0.05em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Shared game card — matches sidebar nav-item border style */
.game-card {
  border: 1px solid rgba(51, 65, 85, 0.3);
  background: rgba(30, 41, 59, 0.3);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.game-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(30, 41, 59, 0.5);
}

.game-card-inner {
  border: 1px solid rgba(51, 65, 85, 0.2);
  background: rgba(15, 23, 42, 0.4);
}

.glow-border-cyan {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), inset 0 0 20px rgba(6, 182, 212, 0.1);
}

.glow-border-cyan-strong {
  box-shadow: 0 0 30px var(--cyan-glow-soft), inset 0 0 30px rgba(6, 182, 212, 0.15);
}

/* ============================================
   Gradient Background Overlays
   ============================================ */
.bg-overlay-gradient {
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.4), rgba(15, 23, 42, 0.35));
}

.bg-grid-pattern {
  background-image: repeating-linear-gradient(0deg, rgba(6, 182, 212, 0.1) 0px, transparent 1px, transparent 2px, rgba(6, 182, 212, 0.1) 3px);
}

/* ============================================
   Gradient Lines (for edges)
   ============================================ */
.gradient-line-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.6), transparent);
  filter: blur(1px);
}

.gradient-line-right {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(6, 182, 212, 0.6), rgba(6, 182, 212, 0.2), transparent);
  filter: blur(1px);
}

.gradient-line-left {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(6, 182, 212, 0.6), rgba(6, 182, 212, 0.2), transparent);
  filter: blur(1px);
}

.gradient-line-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.8), transparent);
  filter: blur(0.5px);
}

/* ============================================
   Active State Indicators
   ============================================ */
.active-indicator-left {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 75%;
  background: linear-gradient(to bottom, var(--cyan-400), var(--cyan-600));
  box-shadow: 0 0 10px var(--cyan-glow);
  filter: blur(0.5px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan-400);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan-glow), 0 0 20px var(--cyan-glow-soft);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   Animations
   ============================================ */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-left {
  animation: slide-in-left 0.3s ease-out;
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

/* ============================================
   Resource Display Components
   ============================================ */
.resource-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  transition: all 0.3s ease;
}

.resource-box:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

/* ============================================
   Navigation Items
   ============================================ */
.nav-item {
  position: relative;
  display: block;
}

.nav-item-bg {
  position: absolute;
  inset: 0;
  transition: all 0.3s ease;
  border: 1px solid rgba(51, 65, 85, 0.3);
  background: rgba(30, 41, 59, 0.2);
}

.nav-item:hover .nav-item-bg,
.group:hover .nav-item-bg {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(30, 41, 59, 0.4);
}

.nav-item.active .nav-item-bg {
  background: linear-gradient(to right, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.05));
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), inset 0 0 20px rgba(6, 182, 212, 0.1);
}

/* ============================================
   Planet Cards
   ============================================ */
.planet-card {
  position: relative;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.planet-card-bg {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(51, 65, 85, 0.3);
  background: rgba(30, 41, 59, 0.2);
  transition: all 0.3s ease;
}

.planet-card:hover .planet-card-bg {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(30, 41, 59, 0.4);
}

.planet-card.active .planet-card-bg {
  background: linear-gradient(to bottom right, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1), transparent);
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), inset 0 0 30px rgba(6, 182, 212, 0.1);
}

/* ============================================
   Phalanx Dialog
   ============================================ */
.phalanx-dialog {
  background: rgba(15, 12, 35, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 12px;
  width: calc(100vw - 500px);
  max-width: 700px;
  padding: 0;
  box-shadow: 0 0 40px rgba(167, 139, 250, 0.15);
  font-family: monospace;
  margin: 0;
}

.phalanx-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ============================================
   Mobile Utilities
   ============================================ */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.mobile-menu-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 16rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  z-index: 50;
  overflow-y: auto;
}

.mobile-dropdown {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 16rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(51, 65, 85, 0.5);
  z-index: 50;
  overflow-y: auto;
}

/* ============================================
   Responsive Helpers
   ============================================ */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none !important;
  }
}

/* ============================================
   Button Styles
   ============================================ */
.btn-primary-glow {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan-400);
  border: 1px solid rgba(6, 182, 212, 0.3);
  transition: all 0.3s ease;
}

.btn-primary-glow:hover {
  background: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* ============================================
   Typography
   ============================================ */
.brand-text {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(to right, var(--cyan-400), var(--blue-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px var(--cyan-glow-soft), 0 0 40px rgba(6, 182, 212, 0.2);
}

.section-label {
  font-size: 0.625rem;
  color: rgba(6, 182, 212, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* ============================================
   Inventory Thumbnails
   ============================================ */
.thumb {
  position: relative;
  width: 72px;
  height: 80px;
  background: linear-gradient(135deg, #112038, #0a1628);
  border-radius: 4px;
  border: 2px solid #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 9px;
  padding: 4px 0;
  gap: 2px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.thumb:hover { transform: translateY(-2px); }
.thumb i { width: 24px; height: 24px; }
.thumb-effect { font-size: 10px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.thumb-qty {
  position: absolute; top: -5px; right: -5px;
  background: #f1f5f9; color: #0f172a;
  border-radius: 8px; padding: 0 5px;
  font-size: 9px; font-weight: 700;
  min-width: 18px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.thumb.tier-common    { border-color: #6b7280; }
.thumb.tier-rare      { border-color: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.35); }
.thumb.tier-epic      { border-color: #a855f7; box-shadow: 0 0 8px rgba(168,85,247,0.45); }
.thumb.tier-legendary { border-color: #f97316; box-shadow: 0 0 8px rgba(249,115,22,0.55); }
.thumb.tier-mythic    { border-color: #e5cc80; box-shadow: 0 0 8px rgba(229,204,128,0.65); }
.thumb.tier-rare    .thumb-effect { color: #3b82f6; }
.thumb.tier-epic    .thumb-effect { color: #a855f7; }
.thumb.tier-legendary .thumb-effect { color: #f97316; }
.thumb.tier-mythic  .thumb-effect { color: #e5cc80; }

/* Tier label text colors (used in detail panel and active panel) */
.tier-common    { color: #6b7280; }
.tier-rare      { color: #3b82f6; }
.tier-epic      { color: #a855f7; }
.tier-legendary { color: #f97316; }
.tier-mythic    { color: #e5cc80; }

/* Tier-colored detail panel borders and backgrounds */
.tier-panel-common    { border-color: rgba(107,114,128,0.3);  background: rgba(30,41,59,0.3); }
.tier-panel-rare      { border-color: rgba(59,130,246,0.4);   background: rgba(59,130,246,0.04); }
.tier-panel-epic      { border-color: rgba(168,85,247,0.4);   background: rgba(168,85,247,0.04); }
.tier-panel-legendary { border-color: rgba(249,115,22,0.4);   background: rgba(249,115,22,0.04); }
.tier-panel-mythic    { border-color: rgba(229,204,128,0.4);  background: rgba(229,204,128,0.04); }
