/* Friend Memo - Modern UI Styles */

/* ============================================
   Base Styles
   ============================================ */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent text selection on buttons */
button {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Glassmorphism Header
   ============================================ */
header {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5) !important;
}

/* Sticky elements with glass effect */
.sticky {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   Side Menu Animation
   ============================================ */
.side-menu-content {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#side-menu .side-menu-overlay {
  transition: opacity 0.3s ease;
}

/* ============================================
   Scrollbar Styles
   ============================================ */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

#group-filter {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#group-filter::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Card Animations
   ============================================ */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.friend-card,
.log-item,
.group-item {
  opacity: 0;
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   Shadow Styles
   ============================================ */
.shadow-card {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shadow-soft {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
#fab-btn, 
#add-log-btn {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
  transform: scale(1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fab-btn:hover, 
#add-log-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
}

#fab-btn:active, 
#add-log-btn:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* ============================================
   Modal Animations
   ============================================ */
#quick-modal,
#log-modal,
#group-modal,
#delete-modal {
  transition: opacity 0.2s ease;
}

#quick-modal > div:nth-child(2),
#log-modal > div:nth-child(2),
#group-modal > div:nth-child(2),
#delete-modal > div:nth-child(2) {
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { 
    opacity: 0; 
    transform: translateY(20px) scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Modal backdrop blur */
#quick-modal > div:first-child,
#log-modal > div:first-child,
#group-modal > div:first-child,
#delete-modal > div:first-child {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================================
   Form Styles
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  transition: all 0.2s ease;
  border-color: #E5E7EB;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox custom style */
input[type="checkbox"] {
  accent-color: #3B82F6;
  transition: all 0.2s ease;
}

/* Radio custom style */
input[type="radio"] {
  accent-color: #3B82F6;
}

/* Date input style */
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
}

/* ============================================
   Button Styles
   ============================================ */
button {
  transition: all 0.2s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Primary button hover effect */
.bg-blue-500:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================
   Color Picker
   ============================================ */
.color-btn {
  transition: all 0.2s ease;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.ring-blue-500 {
  ring-color: #3B82F6;
  transform: scale(1.1);
}

/* ============================================
   Log Type Tab Styles
   ============================================ */
.log-tab-btn {
  position: relative;
  transition: all 0.2s ease;
}

.log-tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #3B82F6;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
}

.log-tab-btn.border-blue-500::after,
.log-tab-btn:hover::after {
  width: 100%;
}

/* ============================================
   Timeline Styles
   ============================================ */
#logs-list .log-item::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: -16px;
  width: 1px;
  background: linear-gradient(to bottom, #E5E7EB, transparent);
}

#logs-list .log-item:last-child::before {
  display: none;
}

/* ============================================
   User Menu Styles
   ============================================ */
#user-menu {
  animation: fadeInDown 0.2s ease;
}

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

/* ============================================
   PWA Standalone Styles
   ============================================ */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================
   Loading Spinner
   ============================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* ============================================
   Transitions
   ============================================ */
.transition {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* ============================================
   Empty State Styles
   ============================================ */
#friends-list > div:only-child,
#logs-list > div:only-child,
#groups-list > div:only-child {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Selection Styles
   ============================================ */
::selection {
  background-color: rgba(59, 130, 246, 0.2);
  color: #1E40AF;
}

/* ============================================
   Focus Visible Styles
   ============================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* ============================================
   Avatar Hover Effect
   ============================================ */
.friend-card .w-12 {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.friend-card:hover .w-12 {
  transform: scale(1.08);
}

/* ============================================
   Group Filter Pills
   ============================================ */
.group-filter-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.group-filter-btn:hover {
  transform: translateY(-1px);
}

.group-filter-btn:active {
  transform: translateY(0);
}
