/* Chatvora — micro-interactions, motion, scrollbars */

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sr-spinner-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Buttons (site-wide) --- */
button:not(:disabled),
[type='button']:not(:disabled),
[type='submit']:not(:disabled),
input[type='submit']:not(:disabled),
.btn:not(:disabled):not(.disabled),
a.default-btn:not(.disabled),
button.default-btn:not(:disabled) {
  transition:
    filter 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease,
    outline-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

button:not(:disabled):hover,
[type='button']:not(:disabled):hover,
[type='submit']:not(:disabled):hover,
input[type='submit']:not(:disabled):hover,
.btn:not(:disabled):not(.disabled):hover,
a.default-btn:not(.disabled):hover,
button.default-btn:not(:disabled):hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button:not(:disabled):active,
[type='button']:not(:disabled):active,
[type='submit']:not(:disabled):active,
input[type='submit']:not(:disabled):active,
.btn:not(:disabled):not(.disabled):active,
a.default-btn:not(.disabled):active,
button.default-btn:not(:disabled):active {
  transform: translateY(0);
  filter: brightness(0.92);
}

button:focus-visible,
[type='button']:focus-visible,
[type='submit']:focus-visible,
input[type='submit']:focus-visible,
.btn:focus-visible,
a.default-btn:focus-visible,
button.default-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

/* Don’t lift icon-only / nav controls that use transforms elsewhere */
.sr-navbar__menu-site:hover,
.sr-main__menu-btn:hover,
.navbar-toggler:hover {
  transform: none;
  filter: brightness(1.08);
}

.sr-navbar__menu-site:active,
.sr-main__menu-btn:active,
.navbar-toggler:active {
  transform: none;
  filter: brightness(0.95);
}

/* --- Dashboard cards --- */
.sr-dash-stat-card {
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  cursor: default;
}

.sr-dash-stat-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.sr-dash-conv-row {
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

.sr-dash-conv-row:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

/* --- Sidebar conversations --- */
.sr-conv-item {
  border-radius: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    border-left 0.15s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
}

.sr-conv-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sr-conv-item.active,
.sr-conv-item.is-active {
  background: rgba(99, 102, 241, 0.12);
  border-color: transparent;
  border-left: 3px solid #6366f1;
  padding-left: calc(0.45rem - 2px);
}

.sr-conv-title {
  max-width: calc(100% - 60px);
  min-width: 0;
}

.sr-conv-delete {
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    filter 0.15s ease,
    transform 0.15s ease;
}

.sr-conv-item:hover .sr-conv-delete {
  opacity: 1;
  pointer-events: auto;
}

.sr-conv-delete:hover {
  color: #fecaca !important;
  background: rgba(248, 113, 113, 0.18) !important;
}

/* --- Composer focus ring --- */
.sr-composer {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.sr-composer:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sr-chat__composer:focus-within {
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.sr-home-hero-composer .sr-chat__composer:focus-within,
body.sr-chat-app .sr-claude-composer-outer .sr-chat__composer:focus-within {
  border-color: transparent !important;
  box-shadow: none !important;
}

.sr-home-hero-composer .sr-chat__input:focus,
body.sr-chat-app .sr-claude-composer-outer .sr-chat__input:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* --- Chat bubbles enter --- */
.sr-bubble-wrap,
.sr-home-bubble-wrap {
  animation: bubbleIn 0.2s ease;
}

/* --- Loading spinner --- */
.sr-spinner {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}

.sr-spinner > * {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.6);
  animation: sr-spinner-bounce 1.2s infinite ease-in-out;
  flex-shrink: 0;
}

.sr-spinner > *:nth-child(1) {
  animation-delay: -0.32s;
}

.sr-spinner > *:nth-child(2) {
  animation-delay: -0.16s;
}

.sr-composer .sr-chat__send .sr-spinner,
.sr-chat__send .sr-spinner {
  padding: 0 2px;
  gap: 3px;
}

.sr-composer .sr-chat__send .sr-spinner > *,
.sr-chat__send .sr-spinner > * {
  width: 6px;
  height: 6px;
}

/* --- Scrollbars --- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Mobile: prevent iOS zoom on composer/auth inputs (16px minimum) --- */
@media (max-width: 767.98px) {
  textarea.sr-chat__input,
  select.sr-chat__model-select {
    font-size: 16px !important;
  }

  #sr-home-input.sr-home-input {
    font-size: 16px !important;
  }

  html.sr-chat-page-html body.sr-chat-page {
    overflow-x: hidden;
  }
}

/* --- Quota modal CTAs: clearer hover affordance --- */
.sr-quota-modal__btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .sr-quota-modal__btn-primary:hover {
    transform: none;
  }
}

/* --- Accessibility: minimum tap target ~44px (Lighthouse / WCAG) --- */
.sr-footer__links a,
.sr-footer__mailto {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  box-sizing: border-box;
}

.social-profile li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
}

/* Owl Carousel — dot buttons sitewide (testimonials, legacy sliders) */
.owl-carousel.owl-theme .owl-dots .owl-dot {
  min-width: 44px;
  min-height: 44px;
  margin: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.owl-carousel.owl-theme .owl-dots .owl-dot span {
  margin: 0 auto !important;
}
