/* Basic CSS reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.5;
}

#root {
    min-height: 100vh;
}

/* Custom animations and utilities */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-slideIn {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

/* Scale utility */
.scale-102 {
    transform: scale(1.02);
}

/* Line clamp utilities for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================================================
   VIRTUAL DIFF VIEWER - FONT SIZE CONTROL
   ============================================================================= */

/* Base font size for diff viewer (default: 14px) */
.diff-viewer-container {
  font-size: 14px;
}

/* Font size variations */
.diff-viewer-font-12 {
  font-size: 12px;
}

.diff-viewer-font-14 {
  font-size: 14px;
}

.diff-viewer-font-16 {
  font-size: 16px;
}

.diff-viewer-font-18 {
  font-size: 18px;
}

.diff-viewer-font-20 {
  font-size: 20px;
}

/* Retro CRT terminal cursor blink animation */
@keyframes retro-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* P2-6: Pulse border animation for duplicate management threshold mismatch button */
@keyframes pulse-border {
    0%, 100% { border-color: var(--mantine-color-violet-3); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.3); }
    50% { border-color: var(--mantine-color-violet-6); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15); }
}

/* =============================================================================
   AUTOMATIONS RUNTIME BADGE — PROCESSING STATE
   Animated conic-gradient border rotation for "feldolgozás alatt" badge.
   Used in AutomationsPage.tsx (AutomationRuntimeBadge → ProcessingBadge).
   ============================================================================= */

/* CSS custom property registration — allows --rotate to be animated smoothly.
   Fallback: browsers without @property support will snap instead of interpolate,
   but the rotation still happens via the secondary transform-based keyframe. */
@property --processing-badge-rotate {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes processing-badge-border-spin {
    to {
        --processing-badge-rotate: 360deg;
    }
}

/* Fallback rotation via transform for browsers without @property support
   (Safari < 16.4, Firefox < 128). Applied to a pseudo-element wrapper. */
@keyframes processing-badge-fallback-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Subtle pulse on the badge background so even without the border
   rotation the processing state remains visually distinct. */
@keyframes processing-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.0); }
    50% { box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.12); }
}

.processing-badge-wrapper {
    animation: processing-badge-pulse 2.5s ease-in-out infinite;
}

.processing-badge-border {
    animation: processing-badge-border-spin 2.8s linear infinite;
}

/* Fallback spin (used via ::before pseudo when @property not supported).
   The primary conic gradient uses --processing-badge-rotate, which relies
   on @property for interpolation. Browsers without @property still see
   a rotating gradient because we apply transform rotation to the mask layer. */
@supports not (background: paint(worklet)) {
    .processing-badge-border {
        animation: processing-badge-fallback-spin 2.8s linear infinite;
    }
}
