/**
 * Sources Athenas - License Server
 * Dark Magic Theme with Animations
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600;700&family=Fira+Code&display=swap');

/* ===========================================
   ROOT VARIABLES
   =========================================== */
:root {
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-secondary: #3b82f6;
  --color-gold: #fbbf24;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-dark: #0a0a0f;
  --color-darker: #050508;
}

/* ===========================================
   GLOBAL STYLES
   =========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(ellipse at top, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #050508 0%, #0a0a12 50%, #0f0a15 100%);
  background-attachment: fixed;
  color: #e5e7eb;
  min-height: 100vh;
}

/* ===========================================
   SCROLLBAR
   =========================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed 0%, #3b82f6 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a78bfa 0%, #60a5fa 100%);
}

/* ===========================================
   MAGIC PARTICLES BACKGROUND
   =========================================== */
.magic-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.magic-particles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(251, 191, 36, 0.04) 0%, transparent 60%);
  animation: ambient-glow 15s ease-in-out infinite alternate;
}

@keyframes ambient-glow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ===========================================
   CONTAINER
   =========================================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ===========================================
   HEADER
   =========================================== */
header {
  text-align: center;
  padding: 40px 0 30px;
  animation: fade-in 0.6s ease-out;
}

header h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #3b82f6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-shine 3s linear infinite;
  text-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
}

@keyframes title-shine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.subtitle {
  color: #9ca3af;
  margin-top: 8px;
  font-size: 1rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-left h1 {
  text-align: left;
}

.header-left .subtitle {
  text-align: left;
}

/* ===========================================
   STATS CARDS
   =========================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  animation: slide-in-up 0.5s ease-out;
}

.stat-card {
  background: linear-gradient(135deg, rgba(15, 10, 21, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.2);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.active {
  border-color: rgba(34, 197, 94, 0.5);
}

.stat-card.active:hover {
  box-shadow: 0 10px 40px rgba(34, 197, 94, 0.2);
}

.stat-card.online {
  border-color: rgba(59, 130, 246, 0.5);
}

.stat-card.online:hover {
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.active .stat-number {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.online .stat-number {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  color: #9ca3af;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ===========================================
   BUTTONS
   =========================================== */
.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  animation: slide-in-up 0.5s ease-out 0.1s both;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  border: 1px solid rgba(124, 58, 237, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: rgba(15, 10, 21, 0.8);
  color: #e5e7eb;
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: 1px solid rgba(220, 38, 38, 0.5);
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* ===========================================
   TABLE
   =========================================== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: linear-gradient(135deg, rgba(15, 10, 21, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  overflow: hidden;
  animation: scale-in 0.4s ease-out 0.2s both;
}

thead {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.15) 0%, rgba(15, 10, 21, 0.9) 100%);
}

thead th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: #a78bfa;
  border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(124, 58, 237, 0.1);
}

tbody td {
  padding: 16px;
  color: #d1d5db;
}

/* ===========================================
   STATUS BADGES
   =========================================== */
.status-active {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.3));
  color: #4ade80;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-inactive {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
  color: #f87171;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pending {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.3));
  color: #fbbf24;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.hardware-id {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #9ca3af;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
}

/* ===========================================
   ACTION BUTTONS
   =========================================== */
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===========================================
   MODAL
   =========================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: linear-gradient(135deg, rgba(15, 10, 21, 0.98) 0%, rgba(10, 10, 15, 0.99) 100%);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 80px rgba(124, 58, 237, 0.3), 0 0 100px rgba(59, 130, 246, 0.1);
  animation: modal-appear 0.4s ease-out;
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  transform: rotate(90deg);
}

/* ===========================================
   FORM STYLES
   =========================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #d1d5db;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2), 0 0 20px rgba(124, 58, 237, 0.1);
}

.form-group input::placeholder {
  color: #6b7280;
}

.form-group small {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.85rem;
}

.form-group input[type="checkbox"] {
  width: auto;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: rgba(10, 10, 15, 0.8);
  border: 2px solid rgba(124, 58, 237, 0.5);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-right: 10px;
}

.form-group input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-color: #a78bfa;
}

.form-group input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(124, 58, 237, 0.2);
}

/* ===========================================
   ANIMATIONS
   =========================================== */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.5), 0 0 60px rgba(59, 130, 246, 0.3);
  }
}

/* ===========================================
   FLATPICKR DARK THEME OVERRIDE
   =========================================== */
.flatpickr-calendar {
  background: rgba(15, 10, 21, 0.98) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-day.selected {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
}

.flatpickr-day:hover {
  background: rgba(124, 58, 237, 0.3) !important;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.9rem;
  }

  thead th, tbody td {
    padding: 12px 8px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 20px;
    margin: 10px;
  }
}
