/* Circular Loading Animation */
.loading-circle-container {
  width: 200px;
  height: 200px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.loading-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(92, 134, 255, 0.05), rgba(39, 94, 254, 0.05));
  position: relative;
  filter: blur(15px);
  animation: pulse 2s infinite ease-in-out;
  transition: background 0.5s ease;
}

.loading-circle-progress {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  mask: radial-gradient(transparent 55%, black 55%);
  -webkit-mask: radial-gradient(transparent 55%, black 55%);
  animation: rotate 2s linear infinite;
  transition: background 0.5s ease;
}

/* State-specific styles */
.loading-circle.uploading {
  background: linear-gradient(135deg, rgba(92, 134, 255, 0.05), rgba(39, 94, 254, 0.05));
}

.loading-circle.classifying {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
}

.loading-circle.saving {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.05), rgba(202, 138, 4, 0.05));
}

.loading-circle-progress.uploading {
  background: conic-gradient(
    from 0deg,
    rgba(92, 134, 255, 0.3) 0%,
    rgba(39, 94, 254, 0.3) 50%,
    rgba(92, 134, 255, 0.3) 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.loading-circle-progress.classifying {
  background: conic-gradient(
    from 0deg,
    rgba(16, 185, 129, 0.3) 0%,
    rgba(5, 150, 105, 0.3) 50%,
    rgba(16, 185, 129, 0.3) 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 75%, 0 75%);
}

.loading-circle-progress.saving {
  background: conic-gradient(
    from 0deg,
    rgba(234, 179, 8, 0.3) 0%,
    rgba(202, 138, 4, 0.3) 50%,
    rgba(234, 179, 8, 0.3) 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    filter: blur(15px);
  }
  50% {
    transform: scale(1.05);
    filter: blur(8px);
  }
  100% {
    transform: scale(1);
    filter: blur(15px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Deleting Overlay */
.deleting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 2001; /* Higher than other overlays */
}

.deleting-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ef4444; /* Red color for delete */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.deleting-overlay p {
  margin-top: 16px;
  font-size: 16px;
  color: #ef4444; /* Red color for delete */
}

/* Edit Form Styles */
.edit-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #5C86FF;
}

.form-textarea {
  width: 100%;
  height: 200px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: #5C86FF;
}

/* Emoji Picker Styles */
.emoji-picker-container {
  position: relative;
  width: 100%;
}

emoji-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 400px;
  z-index: 1000;
  display: none;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  background: white;
  --background: white;
  --border-color: #e0e0e0;
  --button-active-background: #f5f5f5;
  --button-hover-background: #f5f5f5;
  --category-font-color: #666;
  --indicator-color: #5C86FF;
  --input-border-color: #e0e0e0;
  --input-font-color: #333;
  --input-placeholder-color: #999;
  --num-columns: 8;
  --outline-color: #5C86FF;
  --category-emoji-padding: 0.5rem;
  --category-emoji-size: 1.375rem;
  --num-rows: 6;
  --outline-border-radius: 8px;
}

emoji-picker.show {
  display: block;
}

/* Style the picker container */
emoji-picker::part(picker) {
  border: none !important;
}

/* Style the search input */
emoji-picker::part(search) {
  margin: 0.5rem !important;
  padding: 0.5rem !important;
}

emoji-picker::part(search-input) {
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  padding: 0.5rem !important;
  font-size: 14px !important;
}

/* Hide skin tone picker */
emoji-picker::part(skin-tone-picker) {
  display: none !important;
}

/* Style the indicator */
emoji-picker::part(indicator) {
  background-color: #5C86FF !important;
  height: 3px !important;
  border-radius: 1.5px !important;
  transition: all 0.2s !important;
  z-index: 1 !important; /* Add z-index to ensure indicator is above other elements */
}

/* Style categories */
emoji-picker::part(categories) {
  padding: 0 0.5rem !important;
  position: relative !important; /* Ensure proper stacking context */
}

emoji-picker::part(category-button) {
  opacity: 0.5;
  transition: opacity 0.2s;
  position: relative !important; /* Ensure proper stacking context */
  z-index: 2 !important; /* Place buttons above the indicator */
}

emoji-picker::part(category-button):hover,
emoji-picker::part(category-button-active) {
  opacity: 1;
  background: none !important;
}

/* Style emojis */
emoji-picker::part(emoji) {
  border-radius: 8px;
  transition: background-color 0.2s;
}

emoji-picker::part(emoji):hover {
  background-color: #f5f5f5;
}

/* Edit Button Styles */
.memory-detail-action-button.edit {
  color: #5C86FF;
}

.memory-detail-action-button.edit:hover {
  background-color: #e6f0ff;
}

.memory-detail-action-button.save {
  color: #10B981;
}

.memory-detail-action-button.save:hover {
  background-color: #e6fff5;
}