@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 7%; /* Slightly lighter than web for work environment */
    --foreground: 0 0% 95%; /* Matches web */

    --card: 0 0% 8%; /* Lighter for better layering */
    --card-foreground: 0 0% 95%;

    --popover: 0 0% 8%;
    --popover-foreground: 0 0% 95%;

    --primary: 24 95% 53%; /* Byaan Orange - from web */
    --primary-foreground: 0 0% 100%;

    --secondary: 0 0% 12%; /* Matches web */
    --secondary-foreground: 0 0% 95%;

    --muted: 0 0% 12%;
    --muted-foreground: 0 0% 65%; /* Improved readability */

    --accent: 330 81% 60%; /* Byaan Pink - from web */
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;

    --border: 0 0% 16%; /* More visible borders */
    --input: 0 0% 14%;
    --ring: 24 95% 53%; /* Orange focus ring */

    --radius: 0.75rem; /* Matches web */

    /* Byaan Brand Colors */
    --brand-orange: 24 95% 53%;
    --brand-orange-hover: 24 90% 50%;
    --brand-orange-muted: 24 85% 48%;
    --brand-pink: 330 81% 60%;
    --brand-pink-muted: 330 60% 55%;

    /* Custom tokens for Byaan - Orange Sunset scheme */
    --gradient-primary: linear-gradient(135deg, hsl(24, 95%, 53%), hsl(330, 81%, 60%));
    --gradient-soft: linear-gradient(180deg, hsl(24, 95%, 53%, 0.1), transparent);
    --glow: 24 95% 53%;
    --glow-soft: 330 81% 60%;
  }

  .dark {
    --background: 0 0% 7%;
    --foreground: 0 0% 95%;

    --card: 0 0% 8%;
    --card-foreground: 0 0% 95%;

    --popover: 0 0% 8%;
    --popover-foreground: 0 0% 95%;

    --primary: 24 95% 53%;
    --primary-foreground: 0 0% 100%;

    --secondary: 0 0% 12%;
    --secondary-foreground: 0 0% 95%;

    --muted: 0 0% 12%;
    --muted-foreground: 0 0% 65%;

    --accent: 330 81% 60%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;

    --border: 0 0% 16%;
    --input: 0 0% 14%;
    --ring: 24 95% 53%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground font-sans antialiased;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply font-mono;
  }
}

/* Global dark background to blend with cards */
html, body, #root {
  height: 100%;
}

body {
  margin: 0;
  background-color: #1a1a1a; /* dark canvas */
  color: #e5e5e5;
  overflow: hidden;
}

/* Fix autocomplete background color */
/* Default for dark backgrounds */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-background-clip: text;
  -webkit-text-fill-color: #e5e5e5 !important;
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: inset 0 0 20px 20px #1a1a1a !important;
}

/* For light/white backgrounds (login, register, invitation forms) */
.bg-white input:-webkit-autofill,
.bg-white input:-webkit-autofill:hover,
.bg-white input:-webkit-autofill:focus,
.bg-white input:-webkit-autofill:active,
.bg-white textarea:-webkit-autofill,
.bg-white textarea:-webkit-autofill:hover,
.bg-white textarea:-webkit-autofill:focus,
.bg-white textarea:-webkit-autofill:active {
  -webkit-text-fill-color: #111827 !important;
  box-shadow: inset 0 0 20px 20px #ffffff !important;
}

/* For inputs with different backgrounds */
.bg-\\[\\#1a1a1a\\] input:-webkit-autofill,
.bg-\\[\\#1a1a1a\\] input:-webkit-autofill:hover,
.bg-\\[\\#1a1a1a\\] input:-webkit-autofill:focus,
.bg-\\[\\#1a1a1a\\] input:-webkit-autofill:active {
  box-shadow: inset 0 0 20px 20px #1a1a1a !important;
}

.bg-\\[\\#2a2a2a\\] input:-webkit-autofill,
.bg-\\[\\#2a2a2a\\] input:-webkit-autofill:hover,
.bg-\\[\\#2a2a2a\\] input:-webkit-autofill:focus,
.bg-\\[\\#2a2a2a\\] input:-webkit-autofill:active {
  box-shadow: inset 0 0 20px 20px #2a2a2a !important;
}

.bg-\\[\\#333333\\] input:-webkit-autofill,
.bg-\\[\\#333333\\] input:-webkit-autofill:hover,
.bg-\\[\\#333333\\] input:-webkit-autofill:focus,
.bg-\\[\\#333333\\] input:-webkit-autofill:active {
  box-shadow: inset 0 0 20px 20px #333333 !important;
}

/* Animated loading dots */
.loading-dots {
  display: inline-block;
}

.loading-dots span {
  display: inline-block;
  animation: loading-wave 1.4s ease-in-out infinite both;
  font-size: inherit;
  margin-left: 2px;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes loading-wave {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0px);
  }
  40% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Custom thin scrollbar styles - ChatGPT style */
.custom-scrollbar,
div[class*="custom-scrollbar"] {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent !important;
}

.custom-scrollbar::-webkit-scrollbar,
div[class*="custom-scrollbar"]::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
}

.custom-scrollbar::-webkit-scrollbar-track,
div[class*="custom-scrollbar"]::-webkit-scrollbar-track {
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
div[class*="custom-scrollbar"]::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25) !important;
  border-radius: 2px !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 20px !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
div[class*="custom-scrollbar"]::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35) !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb:active,
div[class*="custom-scrollbar"]::-webkit-scrollbar-thumb:active {
  background-color: rgba(255, 255, 255, 0.45) !important;
}

.custom-scrollbar::-webkit-scrollbar-corner,
div[class*="custom-scrollbar"]::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Hide scrollbar completely for syntax highlight overlay */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Byaan Brand Utilities */
@layer utilities {
  /* Glow effects - use sparingly for focus states */
  .glow-orange {
    box-shadow: 0 0 20px hsl(var(--glow) / 0.3);
  }

  .glow-orange-sm {
    box-shadow: 0 0 10px hsl(var(--glow) / 0.2);
  }

  .glow-pink {
    box-shadow: 0 0 20px hsl(var(--glow-soft) / 0.3);
  }

  .glow-pink-sm {
    box-shadow: 0 0 10px hsl(var(--glow-soft) / 0.2);
  }

  /* Gradient text */
  .text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  /* Active indicator for sidebar items */
  .active-indicator {
    border-left: 3px solid hsl(var(--brand-orange));
  }
}