/* ==========================================================================
   CSS Scroll-driven Animations — public/scroll-animations.css
   SmartMeeting Visual Enhancement Layer

   Provides scroll-linked visual feedback using pure CSS (no JavaScript).
   Uses CSS Scroll-driven Animations (animation-timeline: scroll()) for
   progress bars and dynamic header shadows.

   Also includes hover/focus interaction effects for buttons, cards, and
   focusable elements. All transition durations are 200ms or less.

   Fallback: browsers that do not support animation-timeline: scroll()
   will hide the progress bar and retain the existing scroll experience.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Task 4.1: Scroll Progress Bar
   Requirements: 5.1, 5.3, 5.4, 5.5
   -------------------------------------------------------------------------- */

/* Keyframes for scroll progress growth */
@keyframes scroll-progress-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Default: hide progress bar on unsupported browsers */
.scroll-progress {
  display: none;
}

/* Show and animate only when scroll-driven animations are supported */
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    display: block;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--dt-accent-primary, var(--accent-main, #1f6feb));
    transform-origin: left center;
    transform: scaleX(0);
    animation: scroll-progress-grow linear forwards;
    animation-timeline: scroll(nearest);
    z-index: 10;
    pointer-events: none;
    border: none;
    margin: 0;
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   Task 4.2: Admin Console Table Header Scroll-linked Shadow
   Requirements: 5.2
   -------------------------------------------------------------------------- */

/* Keyframes for table header shadow on scroll */
@keyframes header-shadow-grow {
  from { box-shadow: none; }
  to   { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
}

@supports (animation-timeline: scroll()) {
  .table-wrapper th {
    animation: header-shadow-grow linear forwards;
    animation-timeline: scroll(nearest);
  }
}

/* --------------------------------------------------------------------------
   Task 4.3: Hover and Focus Effects
   Requirements: 8.1, 8.2, 8.3, 8.4, 8.5

   CSS specificity is kept equal to or lower than existing rules to avoid
   overriding existing hover/focus styles. All transition-duration values
   are 200ms or less (validated by Property 10).
   -------------------------------------------------------------------------- */

/* --- 8.1: Button hover — gradient background shift + shadow expansion --- */
.btn:hover {
  background-image: linear-gradient(
    135deg,
    var(--dt-color-primary-500, var(--accent-main, #1f6feb)) 0%,
    var(--dt-color-primary-700, var(--accent-strong, #1a5cc7)) 100%
  );
  box-shadow: var(--dt-shadow-medium, 0 4px 12px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(15, 23, 42, 0.08));
  transition: background-image 200ms ease, box-shadow 200ms ease;
}

/* --- 8.2: Card hover — lift effect + shadow expansion --- */
.dashboard-card:hover,
.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dt-shadow-large, 0 8px 24px rgba(15, 23, 42, 0.10), 0 24px 48px rgba(15, 23, 42, 0.10));
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* --- 8.3: Keyboard focus ring — outline ring with accent color --- */
:focus-visible {
  outline: 2px solid var(--dt-color-primary-500, var(--accent-main, #1f6feb));
  outline-offset: 2px;
  transition: outline-color 150ms ease;
}
