@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #030508;
  --bg-card: rgba(15, 20, 25, 0.8);
  --text: rgba(255, 255, 255, 0.95);
  --text-muted: rgba(255, 255, 255, 0.6);
  --accent-cyan: #00d4aa;
  --accent-purple: #8b5cf6;
  --gradient: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --glow: 0 0 40px rgba(0, 212, 170, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
}

/* =======================================================================
   KRMEN Particle Canvas
   ======================================================================= */
#particleCanvas,
#starry-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 100% 80% at 50% -30%, rgba(0, 212, 170, 0.15), transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 20%, rgba(139, 92, 246, 0.15), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(59, 130, 246, 0.1), transparent 40%),
    var(--bg);
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }
}

/* =======================================================================
   Landing Page Styles
   ======================================================================= */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: calc(100vh - 160px);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero h1 .gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 2rem;
  background: var(--gradient);
  color: #0a0e14;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px rgba(0, 212, 170, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =======================================================================
   App Shell & Navbar
   ======================================================================= */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 14, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-right: 10px;
}

.nav-brand span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
}

.nav-item {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent-cyan);
  text-decoration: none;
}

.nav-user {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* =======================================================================
   Dashboard Layout & Grid
   ======================================================================= */
.content-area {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.krmen-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.krmen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .krmen-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1600px) {
  .krmen-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.krmen-card:has(.secret-form),
.krmen-card:has(.krmen-input) {
  grid-column: 1 / -1;
  max-width: 600px;
}

.krmen-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.krmen-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-icon {
  font-size: 2rem;
}

.card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.krmen-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 0.5rem;
  transition: color 0.2s;
}

.krmen-card-link:hover .krmen-link {
  color: var(--accent-cyan);
}

/* =======================================================================
   Buttons & Inputs
   ======================================================================= */
.krmen-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.krmen-btn.primary {
  background: var(--gradient);
  color: #0a0e14;
}

.krmen-btn.primary:hover {
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.krmen-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.krmen-btn.secondary:hover {
  border-color: var(--accent-cyan);
}

.krmen-btn.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.krmen-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.krmen-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}

.krmen-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.krmen-input::placeholder {
  color: var(--text-muted);
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* =======================================================================
   Tables & Utilities
   ======================================================================= */
.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.krmen-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.krmen-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.krmen-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--text);
}

.krmen-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-cyan);
}

/* Switch Toggle (for Sections) */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .2s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-cyan);
}

input:checked+.slider:before {
  transform: translateX(16px);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Utils */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

.gap-16 {
  gap: 16px;
}

.mt-16 {
  margin-top: 1rem;
}

.mb-16 {
  margin-bottom: 1rem;
}

.mt-32 {
  margin-top: 2rem;
}

.text-cyan {
  color: var(--accent-cyan);
}

.text-purple {
  color: var(--accent-purple);
}

.muted {
  color: var(--text-muted);
}

/* =======================================================================
   Footer & Foxtana
   ======================================================================= */
.footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.foxtana-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.2s;
  z-index: 100;
}

.foxtana-widget:hover {
  transform: scale(1.1);
}

.fox-avatar {
  font-size: 1.5rem;
}