/* ==========================================================================
   DEVSMARTS Admin — Custom Styles
   Companion to Tailwind CDN + Alpine.js
   Dark theme: bg #0A0A0A / card #1A1A1A / border #2A2A2A / accent #10B981
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base & typography
   -------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  background-color: #0A0A0A;
  color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tighten default link appearance */
a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide up */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shake (validation error feedback) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-6px); }
  30%       { transform: translateX(5px); }
  45%       { transform: translateX(-4px); }
  60%       { transform: translateX(3px); }
  75%       { transform: translateX(-2px); }
  90%       { transform: translateX(1px); }
}

/* Pulse (loading indicators) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* Spin (spinner icons) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Animation utility classes */
.animate-fadeIn  { animation: fadeIn  0.3s ease-out both; }
.animate-slideUp { animation: slideUp 0.2s ease-out both; }
.animate-shake   { animation: shake   0.4s ease-in-out both; }
.animate-pulse   { animation: pulse   2s ease-in-out infinite; }
.animate-spin    { animation: spin    1s linear infinite; }

/* --------------------------------------------------------------------------
   Card hover states
   -------------------------------------------------------------------------- */

.card-hover {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.card-hover:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Condition cards
   -------------------------------------------------------------------------- */

.condition-card {
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.condition-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Badge styles (status & score pills)
   -------------------------------------------------------------------------- */

.status-badge,
.score-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-yellow {
  background-color: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-red {
  background-color: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* --------------------------------------------------------------------------
   Textarea auto-resize
   -------------------------------------------------------------------------- */

.textarea-autoresize {
  overflow: hidden;
  resize: none;
  transition: height 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   Custom scrollbar — dark theme
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #111111;
}

::-webkit-scrollbar-thumb {
  background: #2A2A2A;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

::-webkit-scrollbar-corner {
  background: #111111;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #2A2A2A #111111;
}

/* --------------------------------------------------------------------------
   Focus ring override (dark theme)
   -------------------------------------------------------------------------- */

.focus-visible\:ring-2:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #10B981;
}

:focus-visible {
  outline: 2px solid #10B981;
  outline-offset: 2px;
}

/* Remove default focus for mouse users while keeping keyboard focus */
:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Screen reader only
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Table improvements
   -------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  font-weight: 600;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Alpine.js x-collapse transition support
   (CDN Alpine doesn't include @alpinejs/collapse by default — fallback)
   -------------------------------------------------------------------------- */

[x-collapse] {
  /* Fallback: show/hide handled by x-show, no transition needed without plugin */
}

/* --------------------------------------------------------------------------
   Print reset (minimal — WeasyPrint handles PDF rendering)
   -------------------------------------------------------------------------- */

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  nav, aside, header {
    display: none !important;
  }
}
