/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Shimmer loading effect */
.skeleton {
  position: relative;
  overflow: hidden;
  background-color: #f3f4f6;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-text-sm {
  height: 0.875rem;
  border-radius: 0.25rem;
}

.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.skeleton-avatar.w-16 {
  width: 4rem;
}

.skeleton-avatar.h-16 {
  height: 4rem;
}

.skeleton-badge {
  height: 1.5rem;
  width: 5rem;
  border-radius: 9999px;
}

.skeleton-content {
  height: 4rem;
  border-radius: 0.5rem;
}

/* Fixed background div for cracks overlay (iOS compatible) */
.fixed-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f9fafb;
  background-image: url("/cracks.jpg");
  background-size: auto 100vh;
  background-position: 20% center;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* Hashtag Editor Styles */
.hashtag-editor {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
}

.hashtag-editor:focus {
  border-color: #3b82f6;
  ring: 2px;
  ring-color: rgba(59, 130, 246, 0.5);
}

.hashtag-editor:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.hashtag-editor .hashtag {
  font-weight: 600;
  color: #2563eb;
}

.hashtag-editor .link-text {
  color: #2563eb;
  text-decoration: underline;
  font-weight: normal;
}

/* Make sure hashtags don't break formatting */
.hashtag-editor .hashtag {
  font-weight: 600;
}

.hashtag-editor br {
  display: block;
  content: '';
}

/* Clickable Hashtag Links (for displayed content) */
a.hashtag-link {
  font-weight: 600 !important;
  color: #2563eb !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color 0.2s ease;
}

a.hashtag-link:hover {
  color: #1d4ed8 !important;
  text-decoration: none !important;
}

/* Clickable Content Links (for displayed content) */
a.content-link {
  color: #2563eb !important;
  text-decoration: underline !important;
  cursor: pointer;
  transition: color 0.2s ease;
}

a.content-link:hover {
  color: #1d4ed8 !important;
}

/* Textarea and button wrapper - keeps button positioned with textarea */
.textarea-button-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Attachment Button Styles - positioned relative to textarea wrapper */
.attachment-button {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 6px;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
  z-index: 10;
}

.attachment-button:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.attachment-button:active {
  background-color: #d1d5db;
}

/* Attachment Preview Styles */
.attachment-preview {
  margin-top: 8px;
  display: none;
}

.attachment-preview.has-files {
  display: block;
}

.attachment-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 6px;
}

.attachment-preview-item:last-child {
  margin-bottom: 0;
}

.attachment-preview-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.attachment-preview-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.attachment-preview-name {
  font-size: 0.875rem;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-size {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 8px;
  flex-shrink: 0;
}

.attachment-preview-remove {
  flex-shrink: 0;
  padding: 4px;
  color: #ef4444;
  cursor: pointer;
  transition: color 0.2s ease;
}

.attachment-preview-remove:hover {
  color: #dc2626;
}

.attachment-preview-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 0.375rem;
  margin-right: 8px;
}

/* Upload Progress Styles */
.upload-progress-container {
  margin-top: 8px;
}

.upload-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 6px;
}

.upload-progress-item:last-child {
  margin-bottom: 0;
}

.upload-progress-info {
  flex: 1;
  min-width: 0;
}

.upload-progress-filename {
  font-size: 0.875rem;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.upload-progress-bar-container {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background-color: #3b82f6;
  transition: width 0.2s ease;
  border-radius: 2px;
}

.upload-progress-bar.complete {
  background-color: #10b981;
}

.upload-progress-cancel {
  flex-shrink: 0;
  padding: 4px;
  color: #ef4444;
  cursor: pointer;
  transition: color 0.2s ease;
}

.upload-progress-cancel:hover {
  color: #dc2626;
}

.upload-progress-status {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

/* Note: Attachment Display Styles (post-attachments, attachment-grid, attachment-item, lightbox)
 * are now defined in app/assets/tailwind/application.css with X/Twitter-style layout */

