/* =========================================================================
   AETHERIA ADMIN DASHBOARD STYLES
   Dark Slate & Crimson Modern Aesthetic
   ========================================================================= */

:root {
  --bg-dark: #09090b;
  --bg-card: #121215;
  --border-subtle: #27272a;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
}

body {
  background-color: var(--bg-dark);
  color: #f4f4f5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  width: 100%;
}

/* =========================================================================
   CUSTOM SCROLLBARS
   ========================================================================= */
::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #09090b;
}

::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

.custom-scrollbar::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #121215;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #27272a #121215;
  -webkit-overflow-scrolling: touch;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

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

/* =========================================================================
   FORM ELEMENTS & INPUT ENHANCEMENTS
   ========================================================================= */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
}

/* Glassmorphism Card Effect & Supreme Panels */
.glass-panel {
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(39, 39, 42, 0.85);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

/* Card Surface Hover & Sheen */
.admin-card {
  position: relative;
  background: #121215;
  border: 1px solid #27272a;
  border-radius: 0.75rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.admin-card:hover {
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), 0 0 12px -2px rgba(244, 63, 94, 0.15);
}

/* =========================================================================
   GLOW & ANIMATION UTILITIES
   ========================================================================= */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.3);
  }
  50% {
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.6);
  }
}

.glow-rose {
  animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlowEmerald {
  0%, 100% {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
  }
  50% {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.55);
  }
}

.glow-emerald {
  animation: pulseGlowEmerald 2.5s infinite ease-in-out;
}

@keyframes pulseGlowPurple {
  0%, 100% {
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
  }
  50% {
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.55);
  }
}

.glow-purple {
  animation: pulseGlowPurple 2.5s infinite ease-in-out;
}

/* Modal Entry Keyframe Animation */
@keyframes adminModalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#invseeModal:not(.hidden) > div,
#editPlayerModal:not(.hidden) > div,
#playerDetailModal:not(.hidden) > div,
#imageModal:not(.hidden) > div {
  animation: adminModalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Smooth Interactive Micro-Interactions on Buttons */
button, .btn-interactive {
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, filter 0.15s ease, background-color 0.15s ease;
}

button:active, .btn-interactive:active {
  transform: scale(0.96) !important;
}

@media (hover: hover) {
  button:hover i {
    transition: transform 0.2s ease;
  }
  button:hover i.fa-power-off,
  button:hover i.fa-rotate-right,
  button:hover i.fa-arrows-rotate,
  button:hover i.fa-rotate-left {
    transform: rotate(180deg);
  }
  button:hover i.fa-paper-plane {
    transform: translateX(2px) translateY(-2px);
  }
  button:hover i.fa-circle-info,
  button:hover i.fa-user-gear {
    transform: scale(1.15);
  }
}

/* Minecraft Rank Badges & Roles */
.badge-rank-owner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(190, 18, 60, 0.35));
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.5);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.badge-rank-admin {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  font-weight: 700;
}

.badge-rank-mod {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.35));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.5);
  font-weight: 700;
}

.badge-rank-helper {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.35));
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge-rank-dragonian {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(147, 51, 234, 0.35));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.badge-rank-mvp {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(8, 145, 178, 0.35));
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.badge-rank-vip {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.badge-rank-default {
  background: rgba(39, 39, 42, 0.6);
  color: #a1a1aa;
  border: 1px solid rgba(63, 63, 70, 0.6);
}

/* Auto reload bar gradient shimmer */
@keyframes barShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#autoReloadBar {
  background-size: 200% 200%;
  animation: barShimmer 2s ease infinite;
}

/* =========================================================================
   MOBILE (HP) & TABLET RESPONSIVENESS
   ========================================================================= */

/* Tablet & Mobile shared improvements (max-width: 1024px) */
@media (max-width: 1024px) {
  table {
    font-size: 11px;
  }

  th, td {
    padding-left: 0.625rem !important;
    padding-right: 0.625rem !important;
  }

  /* Modals max height momentum scrolling */
  #invseeModal > div,
  #editPlayerModal > div,
  #playerDetailModal > div {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* HP & Tablet Responsive Navbar Polish */
@media (max-width: 1024px) {
  header nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* HP / Smartphone Specifics (max-width: 640px) */
@media (max-width: 640px) {
  /* Header Nav Bar Compact Scaling without overlap */
  header {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  header .max-w-7xl {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    row-gap: 0.5rem !important;
  }

  header nav {
    padding: 3px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  header nav button {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
    font-size: 11px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  #autoReloadBadge {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    font-size: 9px !important;
  }

  #autoReloadBadge div {
    width: 1.5rem !important;
  }

  #staffProfileBadge {
    max-width: 130px;
    overflow: hidden;
    white-space: nowrap;
  }

  /* Table Cell Padding & White-space rules */
  table {
    font-size: 11px;
    width: 100%;
  }

  th, td {
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* Prevent button misclicks and overlapping in moderation column */
  td .inline-flex {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }

  td button {
    padding: 0.25rem 0.4rem !important;
    font-size: 10.5px !important;
    white-space: nowrap;
  }

  /* Touch optimization for mobile */
  button, a, input, select {
    touch-action: manipulation;
  }

  input[type="date"] {
    min-width: 0;
    max-width: 100%;
  }

  /* Modal Padding & Boundary Fixes */
  #invseeModal, #editPlayerModal, #playerDetailModal, #imageModal {
    padding: 0.375rem !important;
  }

  #invseeModal > div,
  #editPlayerModal > div,
  #playerDetailModal > div,
  #imageModal > div {
    padding: 0.875rem !important;
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 88vh !important;
    border-radius: 0.875rem !important;
  }

  /* Console Terminal Text Size on HP */
  #consoleTerminalWindow {
    font-size: 10.5px;
    min-height: 180px;
    max-height: 300px;
    padding: 0.5rem !important;
    word-break: break-all;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .mc-slot {
    width: 32px !important;
    height: 32px !important;
    border-width: 1.5px !important;
    border-radius: 4px !important;
  }

  .mc-slot-item-img {
    width: 20px !important;
    height: 20px !important;
  }

  .mc-slot-count {
    font-size: 9px !important;
    bottom: 0px !important;
    right: 1px !important;
  }

  #mainInventoryGrid, #hotbarGrid {
    min-width: 300px !important;
    gap: 3px !important;
  }
}

/* =========================================================================
   MINECRAFT INVENTORY (INVSEE) STYLES
   ========================================================================= */
.mc-slot {
  position: relative;
  width: 38px;
  height: 38px;
  background-color: #121215;
  border: 2px solid #27272a;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.8), inset -1px -1px 2px rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

@media (min-width: 640px) {
  .mc-slot {
    width: 44px;
    height: 44px;
  }
}

.mc-slot:hover {
  border-color: #f43f5e;
  background-color: #18181b;
  transform: translateY(-1px);
}

.mc-slot-empty {
  opacity: 0.5;
}

.mc-slot-empty:hover {
  opacity: 0.85;
}

.mc-slot-item-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.7));
}

@media (min-width: 640px) {
  .mc-slot-item-img {
    width: 30px;
    height: 30px;
  }
}

.mc-slot-count {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000000, -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

@media (min-width: 640px) {
  .mc-slot-count {
    font-size: 11px;
    bottom: 2px;
    right: 3px;
  }
}