/* ============================================
   DESIGN SYSTEM - COMPLETE CSS
   Labor Management System - Blazor
   ============================================ */

/* 1. FONTS IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* 2. RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 3. CSS VARIABLES */
:root {
  --radius: 0.75rem;
  --background: 220 15% 96%;
  /* Light gray background */
  --foreground: 222 47% 11%;
  /* Dark blue-gray text */

  /* Gold Palette */
  --gold-100: #FFF9C4;
  --gold-200: #FFF176;
  --gold-300: #FFD700;
  --gold-400: #FDB633;
  --gold-500: #FF8C00;
  --gold-600: #F57F17;

  /* Primary Colors (Gold based) */
  --primary: 43 100% 50%;
  --primary-foreground: 0 0% 100%;

  /* Secondary Colors (Dark Blue based) */
  --secondary: 222 47% 11%;
  --secondary-foreground: 210 40% 98%;

  /* Surface Colors */
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;

  /* Accents */
  --accent: 43 100% 95%;
  --accent-foreground: 43 100% 30%;

  /* Status */
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --success: 142 76% 36%;
  --success-foreground: 356 100% 97%;

  /* Borders & Inputs */
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 43 100% 50%;
}

/* 4. BASE STYLES */
body {
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  direction: rtl;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--secondary));
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }
}

/* 5. ANIMATIONS */
.animate-fade-in {
  animation: fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-in-right {
  animation: slide-in-right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-in {
  animation: scale-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-pulse-gold {
  animation: pulse-gold 2s infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-slide-up {
  animation: slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-flip-in {
  animation: flip-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin 3s linear infinite;
}

.animate-shake {
  animation: shake 0.5s cubic-bezier(0.36, 0, 0.66, -0.56);
}

/* 6. KEYFRAMES */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes flip-in {
  from {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }

  to {
    transform: perspective(400px) rotateY(0);
    opacity: 1;
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.5);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* 7. UTILITY CLASSES */
.gradient-gold {
  background: linear-gradient(135deg, var(--gold-600) 0%, var(--gold-400) 50%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-300) 100%);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-color: var(--gold-200);
}

/* Button animations */
button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active {
  transform: scale(0.98);
}

/* Input focus animations */
input:focus,
select:focus,
textarea:focus {
  animation: focus-ring 0.2s ease-out;
}

@keyframes focus-ring {
  from {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  }

  to {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
  }
}

/* Table row hover */
tbody tr {
  transition: all 0.2s ease-out;
}

tbody tr:hover {
  background-color: rgba(255, 215, 0, 0.05);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Blazor Error UI */
#blazor-error-ui {
  background: #fff3cd;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/* Print Styles */
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide non-printable elements */
  .no-print,
  button,
  .btn {
    display: none !important;
  }

  /* Report content adjustments */
  #reportContent {
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Attachment page breaks */
  div[style*="page-break-before: always"] {
    page-break-before: always !important;
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid !important;
  }

  /* Ensure exact colors */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}



/* 8. MONACO EDITOR OVERRIDES */
.monaco-editor-container {
  width: 100%;
  min-height: 400px;
  height: 400px;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
}

.monaco-editor-override {
  width: 100% !important;
  height: 100% !important;
}