/**
 * Bar Components CSS
 *
 * Styles for Top_Bar and Announcement_Bar components.
 * Includes visibility states and animations.
 *
 * @package Plexa_AI_Theme
 */

/* ==========================================================================
   Bar Heights
   ========================================================================== */

/* Fixed heights only apply within header-bars context */
.header-bars .bar--height-xs {
  height: 40px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-bars .bar--height-xs > div > .grid {
  height: 40px;
}

.header-bars .bar--height-sm {
  height: 60px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-bars .bar--height-sm > div > .grid {
  height: 60px;
}

.header-bars .bar--height-md {
  height: 80px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-bars .bar--height-md > div > .grid {
  height: 80px;
}

.header-bars .bar--height-lg {
  height: 120px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-bars .bar--height-lg > div > .grid {
  height: 120px;
}

.header-bars .bar--height-xl {
  height: 200px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.header-bars .bar--height-xl > div > .grid {
  height: 200px;
}

.bar--height-fill {
  flex: 1;
}

/* ==========================================================================
   Top Bar Mode Styling
   ========================================================================== */

.plexa-top-bar {
  font-size: 1rem;
}

/* Top Bar button overrides */
.plexa-top-bar .btn-sm {
  height: 26px;
  min-height: 26px;
  padding: 0 0.625rem;
  font-size: 0.75rem;
  gap: 0.25rem;
}

/* ==========================================================================
   Announcement Bar Mode Styling
   ========================================================================== */

.plexa-announcement-bar {
  font-size: 0.875rem;
}

/* Gradient mode - background applied via inline style */
.plexa-announcement-bar.gradient-mode {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pattern mode - background-image applied via inline style */
.plexa-announcement-bar.pattern-mode {
  background-repeat: repeat;
  background-size: auto;
}

/* Rounded style (inset with rounded corners) */
.plexa-announcement-bar.rounded-style {
  margin: 0.5rem 1rem;
  border-radius: 0.5rem;
}

/* ==========================================================================
   Announcement Bar States
   ========================================================================== */

.plexa-announcement-bar {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Visible state */
.announcement-bar--visible {
  transform: translateY(0);
  opacity: 1;
}

/* Hidden state */
.announcement-bar--hidden {
  display: none !important;
}

/* Exit animation */
.announcement-bar--hiding {
  animation: announcement-bar-slide-up 0.3s ease forwards;
}

@keyframes announcement-bar-slide-up {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* ==========================================================================
   Copy Feedback
   ========================================================================== */

.copy-feedback {
  position: relative;
}

.copy-feedback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--success-rgb, 34, 197, 94), 0.1);
  border-radius: inherit;
  animation: copy-feedback-pulse 0.3s ease;
}

@keyframes copy-feedback-pulse {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .plexa-announcement-bar {
    transition: none;
  }

  .announcement-bar--hiding {
    animation: none;
    display: none !important;
  }

  .copy-feedback::after {
    animation: none;
  }
}

/* ==========================================================================
   Links Component Layout
   ========================================================================== */

/**
 * Horizontal layout for Links_Component
 * Overrides schema CSS flex-direction: column
 * Usage: "layout": "horizontal" in JSON
 */
.links-horizontal {
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
}

/**
 * Address Component Multiline
 * Ensures address lines display on separate lines
 * Usage: "format": "multiline" in JSON
 */
.address-multiline .address-line {
  display: block;
}
