
/** @import must precede all other statements */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap");

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  /**
   * Tailwind CSS theme
   * tailwind.config.ts expects the following color variables to be expressed as HSL values.
   * A different format will require also updating the theme in tailwind.config.ts.
  */
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;

    --radius: 0.5rem;

    --sidebar-background: 0 0% 98%;

    --sidebar-foreground: 240 5.3% 26.1%;

    --sidebar-primary: 240 5.9% 10%;

    --sidebar-primary-foreground: 0 0% 98%;

    --sidebar-accent: 240 4.8% 95.9%;

    --sidebar-accent-foreground: 240 5.9% 10%;

    --sidebar-border: 220 13% 91%;

    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/* Preloader */
/* Printer Loader Animation Styles */
.preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background: #e8eaed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 1;
  z-index: 10000;
  visibility: visible;
  transition: all 0.8s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.main-content {
  opacity: 0;
  visibility: hidden;
  transition: all 0.8s ease;
}

.main-content.loaded {
  opacity: 1;
  visibility: visible;
}

.loader-container {
  position: relative;
  width: 400px;
  height: 300px;
}

.printer {
  position: absolute;
  bottom: 50px;
  left: 20px;
  width: 180px;
  height: 80px;
  background: #e8eaed;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 2px solid #dadce0;
}

.printer::before {
  content: "";
  position: absolute;
  top: 15px;
  right: -25px;
  width: 30px;
  height: 50px;
  background: #f8f9fa;
  border-radius: 0 6px 6px 0;
  border: 2px solid #dadce0;
  border-left: none;
}

.printer::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 15px;
  width: 120px;
  height: 8px;
  background: #4285f4;
  border-radius: 4px;
  animation: printerLight 2s infinite;
}

/* Printer display screen */
.printer-screen {
  position: absolute;
  top: 25px;
  right: 15px;
  width: 25px;
  height: 15px;
  background: #1a73e8;
  border-radius: 2px;
  border: 1px solid #174ea6;
}

/* Printer buttons */
.printer-button {
  position: absolute;
  top: 45px;
  right: 20px;
  width: 6px;
  height: 6px;
  background: #34a853;
  border-radius: 50%;
  box-shadow: 8px 0 0 #ea4335, 16px 0 0 #fbbc04;
}

/* Paper tray */
.paper-tray {
  position: absolute;
  bottom: -5px;
  left: 10px;
  width: 160px;
  height: 8px;
  background: #dadce0;
  border-radius: 0 0 4px 4px;
}

.paper {
  position: absolute;
  width: 70px;
  height: 50px;
  background: white;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e8eaed;
  bottom: 50px;
  left: 200px;
  opacity: 0;
  animation: paperFly 4s infinite;
}

.paper::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #bdc3c7;
  border-radius: 1px;
}

.paper::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #bdc3c7;
  border-radius: 1px;
}

.loading-text {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: #5f6368;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 1px;
  animation: textPulse 2s infinite;
}

.dots::after {
  content: "Loading";
  animation: dots 1.5s infinite;
}

@keyframes printerLight {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes paperFly {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }
  10% {
    opacity: 1;
    transform: translateX(20px) translateY(0) rotate(5deg) scale(1);
  }
  25% {
    transform: translateX(120px) translateY(-60px) rotate(15deg) scale(0.9);
  }
  50% {
    transform: translateX(200px) translateY(-60px) rotate(-10deg) scale(0.8);
  }
  75% {
    transform: translateX(200px) translateY(20px) rotate(20deg) scale(0.7);
  }
  90% {
    transform: translateX(120px) translateY(20px) rotate(-5deg) scale(0.5);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(80px) translateY(0) rotate(0deg) scale(0.3);
  }
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes dots {
  0%,
  20% {
    content: "Loading";
  }
  40% {
    content: "Loading.";
  }
  60% {
    content: "Loading..";
  }
  80%,
  100% {
    content: "Loading...";
  }
}

/* Additional paper sheets for more dynamic effect */
.paper:nth-child(2) {
  animation-delay: 1s;
}
.paper:nth-child(3) {
  animation-delay: 2s;
}
.paper:nth-child(4) {
  animation-delay: 3s;
}

/* Responsive design */
@media (max-width: 480px) {
  .loader-container {
    width: 300px;
    height: 200px;
  }
  .printer {
    width: 140px;
    height: 60px;
    left: 10px;
    bottom: 40px;
  }
  .printer::before {
    width: 20px;
    height: 35px;
    right: -15px;
  }
  .printer-screen {
    width: 20px;
    height: 12px;
    right: 12px;
    top: 20px;
  }
  .printer-button {
    right: 15px;
    top: 35px;
    width: 5px;
    height: 5px;
    box-shadow: 6px 0 0 #ea4335, 12px 0 0 #fbbc04;
  }
  .paper-tray {
    width: 120px;
    left: 8px;
  }
  .paper {
    width: 55px;
    height: 40px;
    left: 150px;
    bottom: 40px;
  }
  .loading-text {
    font-size: 16px;
  }
}
