@import "tailwindcss";

@theme {
  --color-background: hsl(240 10% 3.9%);
  --color-foreground: hsl(0 0% 98%);
  --color-card: hsl(240 14% 8%);
  --color-card-foreground: hsl(0 0% 98%);
  --color-popover: hsl(240 10% 5%);
  --color-popover-foreground: hsl(0 0% 98%);
  --color-primary: hsl(0 0% 98%);
  --color-primary-foreground: hsl(240 10% 3.9%);
  --color-secondary: hsl(240 6% 12%);
  --color-secondary-foreground: hsl(0 0% 90%);
  --color-muted: hsl(240 6% 10%);
  --color-muted-foreground: hsl(240 5% 65%);
  --color-accent: hsl(240 6% 12%);
  --color-accent-foreground: hsl(0 0% 95%);
  --color-destructive: hsl(0 84% 60%);
  --color-destructive-foreground: hsl(0 0% 100%);
  --color-border: hsl(240 6% 15%);
  --color-input: hsl(240 6% 12%);
  --color-ring: hsl(0 0% 98%);
  --color-success: hsl(142 76% 36%);
  --color-warning: hsl(38 92% 50%);
  --radius: 0.75rem;
  --sidebar-width: 240px;
}

:root {
  color-scheme: dark;
}

@layer base {
  * {
    box-sizing: border-box;
  }

  body {
    @apply bg-background text-foreground antialiased;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-image:
      radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.025) 0px, transparent 60%),
      radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.015) 0px, transparent 60%),
      linear-gradient(rgba(255, 255, 255, 0.004) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.004) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    background-attachment: fixed;
  }

  button,
  a,
  input,
  select,
  textarea {
    transition-property: color, background-color, border-color, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
  }

  button:active:not(:disabled) {
    transform: scale(0.97);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Glass card */
.glass-card {
  background: rgba(18, 18, 26, 0.7) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow:
    0 8px 32px -8px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
}

/* Input styles */
.tool-input {
  background: rgba(10, 10, 16, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #fff;
}
.tool-input:focus {
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06) !important;
  outline: none;
}
.tool-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Result area */
.result-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.75rem;
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Status badges */
.badge-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-err {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.7; }
  70% { transform: scale(1.05); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
@keyframes countdown-tick {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.animate-fade-up {
  animation: fade-up 0.3s ease both;
}
.animate-fade-in {
  animation: fade-in 0.2s ease both;
}

/* TOTP countdown bar */
.countdown-bar {
  transform-origin: left center;
  animation: countdown-tick linear forwards;
}

/* Sidebar active item */
.nav-active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}
