/* danbako UI Enhancements */

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse-gentle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes bounce-gentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.4s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-pulse-gentle {
  animation: pulse-gentle 2s ease-in-out infinite;
}

.animate-bounce-gentle {
  animation: bounce-gentle 1s ease-in-out infinite;
}

/* Stagger children animation */
.stagger-children > * {
  animation: fadeInUp 0.4s ease-out backwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* ===== Card Hover Effects ===== */
.note-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dark .note-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.note-card:hover .note-card-title {
  color: var(--cardboard-dark, rgb(139, 105, 65));
}

.dark .note-card:hover .note-card-title {
  color: var(--cardboard-light, rgb(219, 184, 150));
}

/* Pin indicator pulse */
.pin-indicator {
  animation: pulse-gentle 2s ease-in-out infinite;
}

/* ===== Interactive Elements ===== */
.btn-hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hover-lift:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-hover-lift:active {
  transform: translateY(0);
}

/* Focus ring improvements */
.focus-ring {
  outline: none;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--cardboard, rgb(196, 149, 106));
  outline-offset: 2px;
}


/* ===== Form Enhancements ===== */
.input-glow:focus {
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.2);
}

.dark .input-glow:focus {
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.3);
}

/* ===== Tag Pills ===== */
.tag-pill {
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.tag-pill:hover {
  transform: scale(1.05);
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--cardboard, rgb(196, 149, 106)), var(--cardboard-dark, rgb(139, 105, 65)));
  transform-origin: left;
  transition: transform 0.3s ease;
}

/* ===== Empty State ===== */
.empty-state-icon {
  animation: bounce-gentle 2s ease-in-out infinite;
}

.empty-state-tip {
  animation: fadeInUp 0.5s ease-out backwards;
}

.empty-state-tip:nth-child(1) { animation-delay: 0.2s; }
.empty-state-tip:nth-child(2) { animation-delay: 0.3s; }
.empty-state-tip:nth-child(3) { animation-delay: 0.4s; }

/* ===== Navigation highlight ===== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--cardboard, rgb(196, 149, 106));
  transition: all 0.2s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===== Dropdown Animations ===== */
details[open] > summary ~ * {
  animation: fadeInDown 0.2s ease-out;
}

/* ===== Scrollbar Styling ===== */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.7);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

/* ===== Backdrop Blur for Modals ===== */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ===== Quick Actions Fab ===== */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--cardboard, rgb(196, 149, 106)), var(--cardboard-dark, rgb(139, 105, 65)));
  color: var(--paper, white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(196, 149, 106, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(196, 149, 106, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* ===== Tooltip ===== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.5rem 0.75rem;
  background: rgb(31, 41, 55);
  color: white;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 50;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

.dark .tooltip::after {
  background: rgb(75, 85, 99);
}
