/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import "scrollbar_hide";
@import "service_worker_fix";

/* Global touch/tap effects for buttons and interactive elements */
button,
[role="button"],
.btn,
a.inline-flex,
a.flex,
input[type="submit"],
input[type="button"] {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}

button:active,
[role="button"]:active,
.btn:active,
a.inline-flex:active,
a.flex:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* Clickable card/list item effects */
[onclick],
.cursor-pointer {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, background-color 0.15s ease-out;
}

[onclick]:active,
.cursor-pointer:active {
  transform: scale(0.99);
  background-color: rgba(0, 0, 0, 0.03);
}

/* Prevent text selection on interactive elements for better UX */
button,
[role="button"],
[onclick] {
  -webkit-user-select: none;
  user-select: none;
}

/* Kaminari Pagination Styles */
.pagination {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.pagination span,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.pagination a:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.pagination .current {
  background-color: #111827;
  color: #ffffff;
  border-color: #111827;
}

.pagination .disabled {
  color: #d1d5db;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .first,
.pagination .prev,
.pagination .next,
.pagination .last {
  font-weight: 600;
}

.pagination .gap {
  border: none;
  pointer-events: none;
}
/* Safe header utility for sticky elements */
.app-safe-page {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-safe-page.has-bottom-nav {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
}

.app-safe-header {
  padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
}

.app-safe-sticky {
  top: env(safe-area-inset-top, 0px);
}

html, body {
  touch-action: manipulation;
}

/* ===== Turbo Progress Bar ===== */
.turbo-progress-bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #3b82f6 100%);
  background-size: 200% 100%;
  animation: turbo-progress-shimmer 1s linear infinite;
}

@keyframes turbo-progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Skeleton Loading Styles ===== */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.75rem;
  margin-bottom: 0.375rem;
}

.skeleton-text-lg {
  height: 1.25rem;
  margin-bottom: 0.625rem;
}

.skeleton-avatar {
  border-radius: 9999px;
}

.skeleton-card {
  border-radius: 0.75rem;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Turbo Frame loading state - show skeleton while loading */
turbo-frame[busy] > .skeleton-container {
  display: block;
}

turbo-frame[busy] > .content-container {
  display: none;
}

turbo-frame:not([busy]) > .skeleton-container {
  display: none;
}

turbo-frame:not([busy]) > .content-container {
  display: block;
}
