/* Modern Nexora License Panel - v4 */

:root {
  --bg: #0a0e1a;
  --bg-secondary: #0d1220;
  --panel: #141b2e;
  --panel-light: #1a2238;
  --panel-hover: #1e2845;
  --text: #e8f0ff;
  --text-muted: #8b9cb8;
  --text-dim: #637291;
  --primary: #6c63ff;
  --primary-light: #8f87ff;
  --primary-dark: #5548e0;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.3);
  --success: #00ff88;
  --success-glow: rgba(0, 255, 136, 0.2);
  --danger: #ff4757;
  --danger-glow: rgba(255, 71, 87, 0.2);
  --warning: #ffa502;
  --warning-glow: rgba(255, 165, 2, 0.2);
  --info: #3742fa;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  --glow: rgba(108, 99, 255, 0.15);
}

/* Base Styles & Animations */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--glow), 0 0 40px var(--glow);
  }
  50% {
    box-shadow: 0 0 30px var(--glow), 0 0 60px var(--glow);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: radial-gradient(ellipse at top left, #1a1f3a 0%, var(--bg) 50%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-light);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-secondary) 100%);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
  animation: slideIn 0.5s ease-out;
}

.brand {
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: -0.5px;
  animation: fadeIn 0.6s ease-out;
  position: relative;
}

.brand::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.nav a i {
  width: 20px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.nav a:hover {
  background: var(--panel-hover);
  color: var(--text);
  transform: translateX(4px);
}

.nav a:hover i {
  transform: scale(1.1);
  color: var(--primary-light);
}

.nav a.active {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.15) 0%, rgba(0, 212, 255, 0.08) 100%);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.2);
}

.nav a.active::before {
  transform: scaleY(1);
}

.nav a.active i {
  color: var(--primary-light);
}

/* Content Area */
.content {
  padding: 32px;
  animation: fadeIn 0.6s ease-out;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

h1 {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

h1 i {
  color: var(--primary-light);
  font-size: 28px;
}

h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Styles */
.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease-out;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow), 0 0 40px var(--glow);
}

.card:hover::before {
  opacity: 1;
}

/* Stats Card */
.stat-card {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.1) 0%, transparent 70%);
  transition: all 0.6s ease;
  opacity: 0;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 16px 32px var(--shadow), 0 0 60px var(--glow);
}

.stat-card:hover::after {
  opacity: 1;
  top: -100%;
  right: -100%;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
  color: var(--primary-light);
  transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 16px rgba(108, 99, 255, 0.4);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Grid */
.grid {
  display: grid;
  gap: 20px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Preset Cards */
.preset {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.preset::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108, 99, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.preset:hover {
  border-color: var(--primary);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(108, 99, 255, 0.2);
}

.preset:hover::before {
  left: 100%;
}

.preset .row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

/* Form Elements */
.input,
select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  width: 100%;
}

.input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1), 0 0 20px var(--glow);
  background: var(--panel-light);
}

.input::placeholder {
  color: var(--text-dim);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn i {
  font-size: 14px;
}

.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--panel-hover);
  border-color: var(--border-light);
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #e63946 100%);
  box-shadow: 0 4px 12px var(--danger-glow);
}

.btn.danger:hover {
  box-shadow: 0 8px 20px var(--danger-glow);
}

.btn.ok {
  background: linear-gradient(135deg, var(--success) 0%, #00cc7a 100%);
  color: #003d1f;
  box-shadow: 0 4px 12px var(--success-glow);
}

.btn.ok:hover {
  box-shadow: 0 8px 20px var(--success-glow);
}

.btn.warn {
  background: linear-gradient(135deg, var(--warning) 0%, #ff9100 100%);
  color: #2a1800;
  box-shadow: 0 4px 12px var(--warning-glow);
}

.btn.warn:hover {
  box-shadow: 0 8px 20px var(--warning-glow);
}

/* Icon Buttons */
.iconbtn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.iconbtn:hover {
  background: var(--panel-hover);
  color: var(--text);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.iconbtn.warn {
  background: rgba(255, 165, 2, 0.15);
  color: var(--warning);
  border-color: rgba(255, 165, 2, 0.3);
}

.iconbtn.warn:hover {
  background: rgba(255, 165, 2, 0.25);
  box-shadow: 0 4px 12px var(--warning-glow);
}

.iconbtn.danger {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.3);
}

.iconbtn.danger:hover {
  background: rgba(255, 71, 87, 0.25);
  box-shadow: 0 4px 12px var(--danger-glow);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.badge i {
  font-size: 10px;
}

.badge.active {
  background: rgba(0, 255, 136, 0.15);
  color: var(--success);
  border-color: rgba(0, 255, 136, 0.3);
}

.badge.unused {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  border-color: rgba(0, 212, 255, 0.3);
}

.badge.expired {
  background: rgba(255, 165, 2, 0.15);
  color: var(--warning);
  border-color: rgba(255, 165, 2, 0.3);
}

.badge.revoked {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.3);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin-top: 16px;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.table th {
  background: var(--panel);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: rgba(108, 99, 255, 0.05);
  transform: scale(1.01);
}

.table tbody tr:hover td {
  border-color: var(--primary);
}

.table code {
  background: var(--panel);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.right {
  margin-left: auto;
}

/* Session Panel */
.session-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.session-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.session-panel:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow), 0 0 40px var(--glow);
}

.session-panel:hover::before {
  transform: scaleX(1);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.session-row {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.session-label {
  color: var(--text-dim);
  min-width: 90px;
  font-weight: 500;
}

.session-value {
  color: var(--text);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
}

.session-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Login Page Specific */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  max-width: 420px;
  width: 100%;
  animation: fadeIn 0.8s ease-out;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 28px;
}

/* Utility Classes */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mt-12 {
  margin-top: 12px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mt-24 {
  margin-top: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--panel);
  border-radius: 5px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--panel-hover);
}

/* Loading Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .content {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .stat-value {
    font-size: 28px;
  }
}
