/* ============================================
   LOWKEYLAB DESIGN SYSTEM FOR TICKETSYSTEM
   ============================================ */

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

/* ============================================
   ROOT DESIGN TOKENS
   ============================================ */

:root {
  /* Primary Brand Colors */
  --mint: #47b590;
  --coral: #FF6B47;
  --black: #0E0E0E;

  /* Dark Theme (Default) */
  --bg: #0A0A0A;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: #E5E7EB;
  --text-muted: #9CA3AF;
  --text-bright: #F9FAFB;

  /* Status Colors */
  --status-open: #3b82f6;
  --status-in-progress: #f59e0b;
  --status-resolved: var(--mint);
  --status-closed: #6b7280;
  --status-urgent: var(--coral);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Glow Effects */
  --glow-mint: 0 0 20px rgba(71, 181, 144, 0.3);
  --glow-coral: 0 0 20px rgba(255, 107, 71, 0.3);

  /* Spacing Scale */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* Border Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   LIGHT THEME
   ============================================ */

[data-theme='light'] {
  --bg: #F8FAFC;
  --surface: rgba(0, 0, 0, 0.02);
  --border: rgba(0, 0, 0, 0.08);
  --text: #1F2937;
  --text-muted: #6B7280;
  --text-bright: #0E0E0E;

  /* Lighter shadows for light theme */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection Styling */
::selection {
  background-color: var(--mint);
  color: white;
}

::-moz-selection {
  background-color: var(--mint);
  color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--mint), var(--coral));
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-bright);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-md);
}

/* Monospace elements */
code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ============================================
   KEYBOARD KEY BUTTON COMPONENT
   ============================================ */

.key-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--mint), var(--coral));
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow:
    0 4px 0 0 rgba(71, 181, 144, 0.4),
    0 8px 20px rgba(71, 181, 144, 0.2);
}

.key-button::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--mint), var(--coral));
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
  filter: blur(8px);
}

.key-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 0 rgba(71, 181, 144, 0.4),
    0 12px 30px rgba(71, 181, 144, 0.3);
}

.key-button:hover::before {
  opacity: 0.6;
}

.key-button:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 0 rgba(71, 181, 144, 0.4),
    0 4px 10px rgba(71, 181, 144, 0.2);
}

/* Secondary variant */
.key-button.secondary {
  background: var(--surface);
  color: var(--text-bright);
  border: 1px solid var(--border);
  box-shadow:
    0 4px 0 0 var(--border),
    0 8px 20px rgba(0, 0, 0, 0.1);
}

.key-button.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    0 6px 0 0 var(--border),
    0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Small variant */
.key-button.sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ============================================
   GLASS MORPHISM CARD
   ============================================ */

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: rgba(71, 181, 144, 0.3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ============================================
   INPUT STYLES
   ============================================ */

.input-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.input-field:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(71, 181, 144, 0.1);
}

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

/* Textarea */
.textarea-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  transition: all var(--transition-base);
}

.textarea-field:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(71, 181, 144, 0.1);
}

/* Select */
.select-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.select-field:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(71, 181, 144, 0.1);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge.open {
  background: rgba(59, 130, 246, 0.1);
  color: var(--status-open);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.in-progress {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-in-progress);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.resolved {
  background: rgba(71, 181, 144, 0.1);
  color: var(--status-resolved);
  border: 1px solid rgba(71, 181, 144, 0.2);
}

.badge.closed {
  background: rgba(107, 114, 128, 0.1);
  color: var(--status-closed);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.badge.urgent {
  background: rgba(255, 107, 71, 0.1);
  color: var(--status-urgent);
  border: 1px solid rgba(255, 107, 71, 0.2);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 1000;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--mint);
  box-shadow: var(--glow-mint);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text);
  transition: all var(--transition-base);
}

/* ============================================
   MODAL/OVERLAY
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

/* ============================================
   GRADIENT TEXT
   ============================================ */

.gradient-text {
  background: linear-gradient(135deg, var(--mint), var(--coral));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   TERMINAL COMPONENT
   ============================================ */

.terminal {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--mint);
  overflow-x: auto;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

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

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

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

.justify-center {
  justify-content: center;
}

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

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    --spacing-3xl: 2.5rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}
