/* ============================================
   THOUGHTS FEATURE - Ephemeral Status Bubbles
   ============================================ */

/* Note Bubble Above Profile Avatar */
.thought-bubble-indicator,
.thought-create-button {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  height: 36px;
  padding: 0 16px;
  background: rgba(42, 42, 42, 0.95);
  border: 1.5px solid rgba(8, 145, 178, 0.4);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

/* Override positioning for profile page avatar - hover ABOVE avatar circle */
.profile-avatar-wrapper .thought-bubble-indicator,
.profile-avatar-wrapper .thought-create-button {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.thought-create-button::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(42, 42, 42, 0.95);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.thought-bubble-indicator:hover,
.thought-create-button:hover {
  transform: translateX(-50%) translateY(-2px);
  border-color: #0891b2;
  background: rgba(8, 145, 178, 0.08);
  color: #0891b2;
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.3);
}

.thought-bubble-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}

.thought-bubble-add svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.thought-bubble-active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0891b2;
}

.thought-bubble-active svg {
  width: 16px;
  height: 16px;
}

@keyframes thoughtPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* ============================================
   CREATE THOUGHT MODAL
   ============================================ */

.thought-create-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thought-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.thought-modal-panel {
  position: relative;
  background: var(--bg-primary, #1e1e1e);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: thoughtModalSlideIn 0.3s ease-out;
  color: var(--text-primary, #fff);
}

@keyframes thoughtModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.thought-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.thought-modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #fff);
}

.thought-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.5));
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.thought-modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary, #fff);
}

.thought-modal-body {
  padding: 24px;
}

.thought-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.thought-input {
  width: 100%;
  min-height: 80px;
  padding: 16px;
  border: 2px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  transition: all 0.2s ease;
  outline: none;
  background: var(--bg-elevated, rgba(255,255,255,0.05));
  color: var(--text-primary, #fff);
}

.thought-input::placeholder {
  color: var(--text-muted, rgba(255,255,255,0.4));
}

.thought-input:focus {
  border-color: #00BCD4;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.thought-char-count {
  position: absolute;
  bottom: -24px;
  right: 0;
  font-size: 13px;
  color: #999;
}

.thought-char-count .current {
  font-weight: 600;
  color: #00BCD4;
}

.thought-music-section {
  margin-top: 32px;
}

.thought-add-music-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #00BCD4 0%, #0891B2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thought-add-music-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.thought-selected-music {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-elevated, rgba(255,255,255,0.05));
  border-radius: 12px;
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.thought-music-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.thought-music-album-art {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.thought-music-text {
  flex: 1;
}

.thought-music-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 2px;
}

.thought-music-artist {
  font-size: 13px;
  color: var(--text-muted, rgba(255,255,255,0.6));
}

.thought-music-remove {
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  cursor: pointer;
  transition: all 0.2s ease;
}

.thought-music-remove:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary, #fff);
}

.thought-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.thought-delete-btn {
  padding: 10px 20px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid #e74c3c;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thought-delete-btn:hover {
  background: #e74c3c;
  color: #fff;
}

.thought-share-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #00BCD4 0%, #0891B2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thought-share-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.thought-share-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   THOUGHT PREVIEW MODAL
   ============================================ */

.thought-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thought-preview-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.thought-preview-panel {
  position: relative;
  background: var(--bg-primary, #1e1e1e);
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: thoughtModalSlideIn 0.3s ease-out;
  color: var(--text-primary, #fff);
}

.thought-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.thought-preview-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thought-preview-user img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.thought-preview-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.thought-preview-time {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.thought-preview-close {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.5));
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.thought-preview-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary, #fff);
}

.thought-preview-content {
  padding: 24px;
}

.thought-preview-text {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-primary, #fff);
  margin-bottom: 20px;
  word-wrap: break-word;
}

.thought-preview-music {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(6,214,160,0.08) 0%, rgba(8,145,178,0.12) 100%);
  border: 1px solid rgba(8,145,178,0.2);
  border-radius: 12px;
  position: relative;
}

.thought-preview-music img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.thought-preview-music-info {
  flex: 1;
}

.thought-preview-music-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}

.thought-preview-music-artist {
  font-size: 13px;
  color: var(--text-muted, rgba(255,255,255,0.6));
}

.thought-preview-play {
  background: linear-gradient(135deg, #00BCD4 0%, #0891B2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thought-preview-play:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.thought-preview-stats {
  margin-top: 16px;
  font-size: 13px;
  color: #999;
  text-align: center;
}

.thought-preview-reply {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.thought-reply-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background: var(--bg-elevated, rgba(255,255,255,0.05));
  color: var(--text-primary, #fff);
}

.thought-reply-input::placeholder {
  color: var(--text-muted, rgba(255,255,255,0.4));
}

.thought-reply-input:focus {
  border-color: #00BCD4;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.thought-reply-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #00BCD4 0%, #0891B2 100%);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thought-reply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.thought-preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
  justify-content: flex-end;
}

.thought-edit-btn {
  padding: 10px 20px;
  background: var(--bg-elevated, rgba(255,255,255,0.08));
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  cursor: pointer;
  transition: all 0.2s ease;
}

.thought-edit-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary, #fff);
}

.thought-delete-preview-btn {
  padding: 10px 20px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid #e74c3c;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thought-delete-preview-btn:hover {
  background: #e74c3c;
  color: white;
}

/* ============================================
   THOUGHTS BAR (Feed top)
   ============================================ */

.thoughts-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.thoughts-bar::-webkit-scrollbar {
  display: none;
}

.thought-share-entry {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
  border: 1.5px dashed rgba(102,126,234,0.4);
  border-radius: 20px;
  color: #00BCD4;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.thought-share-entry:hover {
  background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
  border-color: #00BCD4;
  transform: translateY(-1px);
}

#thoughts-feed-bar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 600px) {
  .thought-modal-panel,
  .thought-preview-panel {
    width: 95%;
    margin: 16px;
  }

  .thought-modal-header,
  .thought-preview-header {
    padding: 16px;
  }

  .thought-modal-body,
  .thought-preview-content {
    padding: 16px;
  }

  .thought-preview-text {
    font-size: 16px;
  }
}
