/*
 * 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.
 */

/*********************************************************/
/* every-layout.dev */
/*********************************************************/

.frame {
  --n: 16;
  --d: 9;
  aspect-ratio: var(--n) / var(--d);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;

  & > img,
  & > video {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
}

/*********************************************************/
/* ISBN Lookup Progress Component */
/*********************************************************/

.isbn-lookup {
  margin-top: 1rem;
}

.isbn-lookup__progress {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.isbn-lookup__progress-bar-container {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.isbn-lookup__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b86b2 0%, #5a9fd1 100%);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.isbn-lookup__stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1rem;
}

.isbn-lookup__stepper::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e9ecef;
  z-index: 0;
}

.isbn-lookup__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.isbn-lookup__step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.isbn-lookup__step-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-align: center;
  transition: all 0.3s ease;
}

/* Step States */
.isbn-lookup__step[data-status="checking"] .isbn-lookup__step-icon {
  border-color: #3b86b2;
  background: #e8f4f9;
  animation: pulse 1.5s infinite;
}

.isbn-lookup__step[data-status="checking"] .isbn-lookup__step-label {
  color: #3b86b2;
  font-weight: 500;
}

.isbn-lookup__step[data-status="complete"] .isbn-lookup__step-icon {
  border-color: #3b86b2;
  background: #3b86b2;
  color: white;
}

.isbn-lookup__step[data-status="complete"] .isbn-lookup__step-label {
  color: #3b86b2;
  font-weight: 600;
}

.isbn-lookup__step[data-status="failed"] .isbn-lookup__step-icon {
  border-color: #dc3545;
  background: #f8d7da;
  color: #dc3545;
}

.isbn-lookup__step[data-status="failed"] .isbn-lookup__step-label {
  color: #dc3545;
}

.isbn-lookup__step[data-status="skipped"] .isbn-lookup__step-icon {
  border-color: #6c757d;
  background: #f8f9fa;
  color: #6c757d;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 134, 178, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 134, 178, 0);
  }
}

.isbn-lookup__status {
  font-size: 0.9rem;
  color: #495057;
  text-align: center;
  font-weight: 500;
}

.isbn-lookup__status--success {
  color: #3b86b2;
}

.isbn-lookup__status--error {
  color: #dc3545;
}

/* Results Section */
.isbn-lookup__results {
  background: #e8f4f9;
  border: 2px solid #3b86b2;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.isbn-lookup__results h4 {
  margin: 0 0 0.75rem 0;
  color: #3b86b2;
  font-size: 1rem;
}

.isbn-lookup__images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.isbn-lookup__image-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.isbn-lookup__image-option img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.isbn-lookup__image-option:hover img {
  border-color: #3b86b2;
}

.isbn-lookup__image-option input[type="checkbox"] {
  margin: 0;
}

.isbn-lookup__image-option span {
  font-size: 0.8rem;
  color: #495057;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* PWA Styles */
.offline-banner {
  position: relative;
  background-color: #e24a23;
  color: white;
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
}

.offline-banner.show {
  display: block;
}

.install-button {
  background-color: #e24a23;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.install-button:hover {
  background-color: #c43d1d;
}

.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.sync-indicator.online {
  background-color: #dcfce7;
  color: #166534;
}

.sync-indicator.offline {
  background-color: #fee2e2;
  color: #991b1b;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  background-color: #dc2626;
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pwa-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: #1f2937;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.pwa-toast.success {
  background-color: #059669;
}

.pwa-toast.error {
  background-color: #dc2626;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Note: Install banner styles removed - now accessed from Settings */

/* Update Notification */
.update-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.update-notification.show {
  transform: translateX(0);
}

.update-notification-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.update-icon {
  font-size: 1.5rem;
}

.update-notification-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.update-dismiss {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 6px;
}

.update-dismiss:hover {
  background: #f3f4f6;
}

.update-apply {
  padding: 0.5rem 1rem;
  border: none;
  background: #059669;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
}

.update-apply:hover {
  background: #047857;
}

@media (max-width: 640px) {
  .update-notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

.partner-link img {
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition:
    box-shadow 0.3s ease,
    opacity 0.3s ease;
}
.partner-link:hover img {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

/*********************************************************/
/* Social Media Button Colors */
/*********************************************************/

/* Facebook - Brand Blue #1877F2 */
.btn-social-facebook {
  transition: all 0.2s ease;
}
.btn-social-facebook:hover {
  background-color: #1877F2 !important;
  color: white !important;
  border-color: #1877F2 !important;
}
.btn-social-facebook:hover svg {
  color: white !important;
}

/* Instagram - Brand Pink #E4405F */
.btn-social-instagram {
  transition: all 0.2s ease;
}
.btn-social-instagram:hover {
  background-color: #E4405F !important;
  color: white !important;
  border-color: #E4405F !important;
}
.btn-social-instagram:hover svg {
  color: white !important;
}

/* YouTube - Brand Red #FF0000 */
.btn-social-youtube {
  transition: all 0.2s ease;
}
.btn-social-youtube:hover {
  background-color: #FF0000 !important;
  color: white !important;
  border-color: #FF0000 !important;
}
.btn-social-youtube:hover svg {
  color: white !important;
}

/* Generic dark mode support for social buttons */
@media (prefers-color-scheme: dark) {
  .btn-social-facebook:hover,
  .btn-social-instagram:hover,
  .btn-social-youtube:hover {
    filter: brightness(1.1);
  }
}

/*********************************************************/


[data-sidebar-target="drawer"]:not(.-translate-x-full) {
  transform: translateX(0);
}

/* Sidebar overlay states */
[data-sidebar-target="overlay"].opacity-0 {
  opacity: 0;
  pointer-events: none;
}

[data-sidebar-target="overlay"]:not(.opacity-0) {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu CSS-only animations (shadcn/ui style) */

/* Animation keyframes */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes zoom-in-95 {
  from {
    transform: scale(0.95);
  }
  to {
    transform: scale(1);
  }
}

@keyframes zoom-out-95 {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(0.95);
  }
}

/* Mobile menu item stagger animation */
@keyframes slide-in-from-bottom-2 {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile menu container animations */
.mobile-menu-overlay {
  animation-duration: 100ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* When checkbox is checked - show menu with animations */
.peer:checked ~ .mobile-menu-overlay {
  animation-name: fade-in, zoom-in-95;
}

/* When checkbox is not checked - hide menu with animations */
.peer:not(:checked) ~ .mobile-menu-overlay {
  animation-name: fade-out, zoom-out-95;
}

/* Mobile menu item animations */
.mobile-menu-overlay .mobile-menu-item {
  opacity: 0;
  transform: translateY(8px);
}

.peer:checked ~ .mobile-menu-overlay .mobile-menu-item {
  animation: slide-in-from-bottom-2 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Prevent body scroll when mobile menu is open */
body:has(.peer:checked) {
  overflow: hidden;
}

/* Sidebar Mobile Menu Item Animations */
.sidebar-menu-item {
  opacity: 0;
  transform: translateY(10px);
}

.peer:checked ~ div .sidebar-menu-item {
  animation: sidebar-item-slide-up 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sidebar-item-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile header height offset for main content - override Tailwind p-4 */
main.main-content {
  padding-top: 1rem;
}

@media (max-width: 1023px) {
  main.main-content {
    padding-top: 5rem !important; /* Space for mobile header (h-16 = 64px + some buffer) */
  }
}


