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

/* Cache Wait Overlay Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px) translateY(-50%);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
  }
}

@keyframes bounceHorizontal {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(10px);
  }
}

@keyframes drawArrow {
  from {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
  }
  to {
    stroke-dasharray: 200;
    stroke-dashoffset: 0;
  }
}

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

.animate-slideInLeft {
  animation: slideInLeft 0.5s ease-out;
}

.animate-bounce-horizontal {
  animation: bounceHorizontal 1.5s ease-in-out infinite;
}

.animate-draw-arrow {
  stroke-dasharray: 200;
  stroke-dashoffset: 0;
  animation: drawArrow 1.5s ease-in-out;
}

/* AG Grid Custom Styles */
.ag-theme-alpine {
  --ag-header-background-color: #f9fafb;
  --ag-header-foreground-color: #374151;
  --ag-border-color: #e5e7eb;
  --ag-row-hover-color: #f3f4f6;
  --ag-selected-row-background-color: #dbeafe;
  --ag-cell-horizontal-border: solid #f3f4f6;
  --ag-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ag-theme-alpine .ag-header-cell {
  font-weight: 600;
  font-size: 0.813rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 0 8px;
}

.ag-theme-alpine .ag-row {
  border-bottom: 1px solid #f3f4f6;
}

.ag-theme-alpine .ag-cell {
  display: flex;
  align-items: center;
  padding: 0 8px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Editable cells */
.ag-theme-alpine .editable-cell {
  cursor: pointer;
  transition: all 0.15s ease;
}

.ag-theme-alpine .editable-cell:hover {
  background-color: #fef3c7 !important;
  box-shadow: inset 0 0 0 1px #fbbf24;
}

.ag-theme-alpine .ag-cell-inline-editing {
  background-color: #fff !important;
  box-shadow: 0 0 0 2px #3b82f6 !important;
  padding: 0 8px !important;
}

.ag-theme-alpine .ag-cell-inline-editing input {
  font-weight: 500;
  color: #111827;
}

/* Checkbox styling */
.ag-theme-alpine .ag-checkbox-input-wrapper {
  width: 18px;
  height: 18px;
}

.ag-theme-alpine .ag-checkbox-input-wrapper.ag-checked::after {
  color: #3b82f6;
}

/* Row selection */
.ag-theme-alpine .ag-row-selected {
  background-color: #eff6ff !important;
}

.ag-theme-alpine .ag-row-selected:hover {
  background-color: #dbeafe !important;
}

/* Global styles */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}
