/* Dashboard specific styles */

.dashboard-filters {
  /* Styles pour le formulaire de filtres */
}

.dashboard-filters select {
  background-image: none;
}

.dashboard-filters .filter-active {
  background-color: #e0f2fe;
  border-color: #0288d1;
  color: #01579b;
}

.dashboard-filters .sort-button-active {
  background-color: var(--med-primary-light, #e3f2fd);
  color: var(--med-primary-dark, #1565c0);
}

.dashboard-filters .sort-button-inactive {
  background-color: #f5f5f5;
  color: #666;
}

.dashboard-filters .sort-button-inactive:hover {
  background-color: #e0e0e0;
}

/* Amélioration de l'apparence des selects */
.dashboard-filters select:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--med-primary, #2196f3);
}

/* Animation pour les transitions */
.dashboard-filters button,
.dashboard-filters select,
.dashboard-filters input {
  transition: all 0.2s ease-in-out;
}

/* Responsive design pour les filtres */
@media (max-width: 768px) {
  .dashboard-filters .flex-wrap {
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-filters .flex-grow {
    width: 100%;
  }
}

/* Loading state pour les filtres */
.dashboard-filters.loading {
  opacity: 0.7;
  pointer-events: none;
}

.dashboard-filters.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--med-primary, #2196f3);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Post content formatting */
.post-content-mobile p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.post-content-mobile p:last-child {
  margin-bottom: 0;
}

/* Ensure proper spacing for formatted content */
.post-content-mobile div p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.post-content-mobile div p:last-child {
  margin-bottom: 0;
}

/* File upload styling */
.file-limitations {
  border-radius: 0.375rem;
  padding: 0.5rem;
  border: 1px solid;
  margin-top: 0.5rem;
}

.file-limitations p {
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.file-limitations ul {
  margin-left: 1rem;
  margin-top: 0.25rem;
}

.file-limitations li {
  margin-bottom: 0.25rem;
}

/* File input styling improvements */
input[type="file"] {
  transition: all 0.2s ease-in-out;
}

input[type="file"]:focus {
  outline: 2px solid var(--med-primary, #2196f3);
  outline-offset: 2px;
}

/* Error messages for file uploads */
.file-upload-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.file-upload-error p {
  color: #dc2626;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.file-upload-error p:last-child {
  margin-bottom: 0;
}

/* Image Gallery Styles */
.image-gallery-modal {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-in-out;
}

.image-gallery-modal.hidden {
  animation: fadeOut 0.3s ease-in-out;
}

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

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

.image-gallery-modal button {
  transition: all 0.2s ease-in-out;
}

.image-gallery-modal button:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: scale(1.05);
}

.image-gallery-modal button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-gallery-modal button:disabled:hover {
  transform: none;
}

.image-gallery-modal img {
  transition: opacity 0.3s ease-in-out;
}

.image-gallery-modal img.loading {
  opacity: 0.7;
}

/* Image hover effects in posts */
.post-image-container {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.post-image-container:hover .post-image-overlay {
  opacity: 1;
}

.post-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.post-image-overlay .expand-icon {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 0.5rem;
  color: #374151;
  transition: all 0.2s ease-in-out;
}

.post-image-overlay:hover .expand-icon {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

/* Responsive adjustments for image gallery */
@media (max-width: 768px) {
  .image-gallery-modal .absolute.left-4 {
    left: 1rem;
  }
  
  .image-gallery-modal .absolute.right-4 {
    right: 1rem;
  }
  
  .image-gallery-modal .absolute.top-4 {
    top: 1rem;
  }
  
  .image-gallery-modal .absolute.bottom-4 {
    bottom: 1rem;
  }
  
  .image-gallery-modal button {
    padding: 0.75rem;
  }
  
  .image-gallery-modal button svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Smooth image loading */
.post-image {
  transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.post-image:hover {
  transform: scale(1.02);
}

.post-image.loading {
  opacity: 0.5;
}

/* Image counter badge */
.image-counter-badge {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Touch-friendly navigation buttons */
@media (max-width: 768px) {
  .image-gallery-modal button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Prevent text selection in gallery */
.image-gallery-modal {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Smooth transitions for image changes */
.image-gallery-modal img {
  transition: opacity 0.2s ease-in-out;
}

/* Loading spinner */
.loading-spinner {
  z-index: 60;
}

/* Swipe indicators for mobile */
@media (max-width: 768px) {
  .image-gallery-modal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3) 50%, transparent);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
  }
}