
/* Notes Styles */
.btn {
  @apply inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors duration-200;
}

.btn-primary {
  @apply text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500;
}

.btn-secondary {
  @apply text-gray-700 bg-white border-gray-300 hover:bg-gray-50 focus:ring-blue-500;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card:hover {
  transform: translateY(-2px);
}

.spinner {
  border: 2px solid #f3f4f6;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

#notes-sidebar {
  transition: transform 0.3s ease-in-out;
}

#notes-sidebar.-translate-x-full {
  transform: translateX(-100%) translateY(-50%);
}

.note-menu {
  min-width: 150px;
}

/* Mobile responsive filtering section - CRITICAL FIX */
@media (max-width: 768px) {
  #notes-sidebar {
    left: 8px;
    max-width: 280px;
  }

  .note-card {
    margin-bottom: 1rem;
  }

  /* Mobile-friendly filters layout */
  .user-card .grid.grid-cols-1.md\\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Stack filter elements vertically on mobile */
  .user-card .grid > div {
    width: 100% !important;
  }

  /* Mobile filter inputs styling */
  .user-card input,
  .user-card select {
    width: 100% !important;
    min-height: 44px !important; /* Touch-friendly */
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 0.75rem !important;
    box-sizing: border-box;
  }

  /* Mobile filter buttons container */
  .user-card .flex.space-x-2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  /* Mobile starred filter button */
  #starred-filter {
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
  }

  /* Mobile clear filters button - make it prominent */
  #clear-filters {
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    background-color: #ef4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
  }

  #clear-filters:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px) !important;
  }

  #clear-filters::before {
    content: "Clear All Filters" !important;
    margin-right: 0.5rem;
  }

  #clear-filters i {
    display: none !important; /* Hide the X icon, show text instead */
  }
}

/* Note-taking floating button */
#floating-note-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  display: none;
}

#floating-note-btn:hover {
  background: #d97706;
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

#floating-note-btn i {
  font-size: 20px;
}

/* Note modal */
#note-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#note-modal.hidden {
  display: none;
}

.note-modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* Text selection highlighting */
.post-content ::selection,
.blog-content ::selection {
  background-color: #fef3c7;
  color: #92400e;
}

.post-content ::-moz-selection,
.blog-content ::-moz-selection {
  background-color: #fef3c7;
  color: #92400e;
}

/* Animation classes */
.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

/* Form styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  min-height: 100px;
  resize: vertical;
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #floating-note-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  
  #floating-note-btn i {
    font-size: 18px;
  }
  
  .note-modal-content {
    margin: 16px;
    width: calc(100% - 32px);
  }

  /* Additional mobile notes page improvements */
  .user-card {
    margin: 0.5rem !important;
    padding: 1rem !important;
    border-radius: 0.75rem !important;
  }

  /* Mobile notes grid */
  .notes-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0 0.5rem !important;
  }

  /* Mobile note cards */
  .note-card {
    margin-bottom: 1rem !important;
    padding: 1rem !important;
    border-radius: 0.75rem !important;
  }

  /* Mobile search input with icon */
  .relative input[type="text"] {
    padding-left: 2.5rem !important;
  }

  .relative .fas.fa-search {
    left: 0.75rem !important;
    top: 50% !important;
  }
}
