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

:root {
  --primary-navy: var(--color-slate-900);
  --primary-blue: var(--color-blue-600);
  --bg-slate-50: var(--color-slate-50);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-slate-50);
  color: var(--primary-navy);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global Transition */
.turbo-progress-bar {
  background-color: var(--color-blue-600);
}

/* Page Transition: Pure Turbo Environment (No manual animations) */
main {
  /* Let Turbo Drive handle it naturally */
}

/* 1. Preview State: Keep it clean and static */
html[data-turbo-preview] main {
  pointer-events: none;
}

/* Bottom Nav & Action Bar Layout */
.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-height {
  height: calc(4rem + env(safe-area-inset-bottom, 0px));
}

.bottom-above-nav {
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .bottom-above-nav {
    bottom: 0 !important;
  }
}

/* Form Components */
.form-card {
  background-color: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl-4);
  padding: 1rem;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.05),
    0 2px 4px -2px rgb(0 0 0 / 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .form-card {
    padding: 2.5rem;
  }
}

.form-card:hover {
  border-color: var(--color-blue-200);
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.03),
    0 4px 6px -4px rgb(0 0 0 / 0.03);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-slate-900);
  margin-bottom: 1.5rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background-color: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl-2);
  color: var(--color-slate-900);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.form-input::placeholder {
  color: var(--color-slate-400);
  font-weight: 500;
}

.form-input:focus {
  outline: none;
  background-color: white;
  border-color: var(--color-blue-500);
  box-shadow:
    0 0 0 4px var(--color-blue-50),
    inset 0 2px 4px 0 rgba(0, 0, 0, 0.01);
}

/* Icon & Button Special Paddings */
.input-with-icon {
  padding-left: 3rem !important; /* pl-12 equivalent */
}

.input-with-button {
  padding-right: 3.5rem !important; /* pr-14 equivalent */
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-slate-500);
  margin-bottom: 0.5rem;
  margin-left: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Button Refinement */
.btn-primary {
  @apply bg-blue-600 text-white font-black py-4 px-8 rounded-2xl shadow-lg shadow-blue-600/20 hover:bg-blue-700 active:scale-95 transition-all;
}

.btn-secondary {
  @apply bg-white border border-slate-200 text-slate-700 font-bold py-4 px-8 rounded-2xl hover:bg-slate-50 active:scale-95 transition-all;
}

/* Swipe to Delete Styles */
.swipe-content {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Modal & Bottom Sheet Design System */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background-color: rgb(15 23 42 / 0.6); /* slate-900/60 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
}

.bottom-sheet-overlay:not(.hidden) {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .bottom-sheet-overlay:not(.hidden) {
    align-items: center;
    padding: 1rem;
  }
}

.bottom-sheet-container {
  background-color: white;
  width: 100%;
  max-width: 32rem; /* max-lg */
  border-top-left-radius: 2.5rem;
  border-top-right-radius: 2.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

@media (min-width: 640px) {
  .bottom-sheet-container {
    border-radius: 2.5rem;
  }
}

.animate-backdrop-in {
  animation: backdrop-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-sheet-in {
  animation: sheet-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-sheet-out {
  animation: sheet-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes sheet-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-track:hover {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-slate-200);
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate-300);
}

/* New Item Animation */
.list-item-pop {
  will-change: transform, opacity;
}

/* Transition Masking (Obsolete with Pure Turbo) */
.syncing-mask {
  opacity: 1 !important;
}
