/* Image Gallery Styles */
.image-gallery {
  position: relative;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.image-gallery__container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #f3f4f6;
}

.image-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

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

/* Layout: Single Small */
.image-gallery--single-small .image-gallery__container {
  max-width: 400px;
  margin: 0 auto;
}

.image-gallery--single-small .image-gallery__item {
  width: 100%;
  height: auto;
}

.image-gallery--single-small .image-gallery__item img {
  height: auto;
}

/* Layout: Single Medium */
.image-gallery--single-medium .image-gallery__container {
  max-width: 600px;
  margin: 0 auto;
}

.image-gallery--single-medium .image-gallery__item {
  width: 100%;
  height: auto;
}

.image-gallery--single-medium .image-gallery__item img {
  height: auto;
}

/* Layout: Single Full */
.image-gallery--single-full .image-gallery__container {
  width: 100%;
}

.image-gallery--single-full .image-gallery__item {
  width: 100%;
  height: auto;
}

.image-gallery--single-full .image-gallery__item img {
  height: auto;
}

/* Layout: Double */
.image-gallery--double .image-gallery__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.image-gallery--double .image-gallery__item {
  height: 300px;
}

@media (max-width: 768px) {
  .image-gallery--double .image-gallery__container {
    grid-template-columns: 1fr;
  }
}

/* Layout: Grid */
.image-gallery--grid .image-gallery__container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.image-gallery--grid .image-gallery__item {
  height: 200px;
}

@media (max-width: 768px) {
  .image-gallery--grid .image-gallery__container {
    grid-template-columns: 1fr;
  }
  
  .image-gallery--grid .image-gallery__item {
    height: 250px;
  }
}

/* Layout Controls */
.image-gallery__controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  padding: 4px;
  gap: 4px;
}

.image-gallery:hover .image-gallery__controls,
.image-gallery--selected .image-gallery__controls {
  display: flex;
}

.layout-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.layout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.layout-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Placeholder */
.image-gallery__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #6b7280;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-gallery__placeholder:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Drag and Drop States */
.drag-over {
  background: rgba(59, 130, 246, 0.1);
  border: 2px dashed #3b82f6;
}

/* Upload Progress */
.upload-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.upload-progress__content {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

/* Upload Error */
.upload-error {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ef4444;
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .image-gallery {
    margin: 1.5rem 0;
  }
  
  .image-gallery__controls {
    position: static;
    background: #f3f4f6;
    margin-top: 8px;
    justify-content: center;
  }
  
  .layout-btn {
    background: white;
    color: #374151;
    border-color: #d1d5db;
  }
  
  .layout-btn:hover {
    background: #f9fafb;
  }
  
  .layout-btn.active {
    background: #3b82f6;
    color: white;
  }
}