/* File Upload Component Styles */
.file-upload-container {
  border: 2px dashed var(--file-upload-border-color, #ccc);
  padding: 20px;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
}

.file-upload-button, .file-item {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.file-upload-button {
  border: 1px solid var(--file-upload-border-color, #e5e5e5);
  background-color: #f9f9f9;
  transition: background-color 0.3s;
}
.file-upload-button:hover {
  background-color: #f0f0f0;
}

.file-upload-button .upload-icon {
  font-size: 36px;
  color: #888;
  font-weight: 300;
}

.file-upload-button .upload-text {
  font-size: 14px;
  color: #888;
}

.file-item {
  cursor: default;
}

.file-item .file-preview {
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.file-item .file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-item .file-preview .file-icon {
  width: 50px;
  height: 50px;
}

.file-item .file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 12px;
  padding: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item .delete-file-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s;
}
.file-item .delete-file-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.file-item .upload-status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  /*border-radius: 8px;*/
}

.file-item .upload-status-overlay .error-text {
  color: red;
  font-size: 12px;
  text-align: center;
  padding: 0 5px;
}

.file-item .upload-status-overlay .retry-btn {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.file-item .loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

.error-message {
  color: red;
  font-size: 14px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .file-upload-container {
    padding: 10px;
  }

  .file-list {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
  }

  .file-upload-button, .file-item {
    width: 60px;
    height: 60px;
    border-radius: 6px;
  }

  .file-upload-button .upload-icon {
    font-size: 20px;
  }
  
  .file-upload-button .upload-text {
    font-size: 12px;
  }

  .file-item .file-preview .file-icon {
    width: 24px;
    height: 24px;
  }

  .file-item .upload-status-overlay {
    gap: 4px;
  }

  .file-item .upload-status-overlay .error-text {
    font-size: 10px;
    line-height: 1.1;
  }

  .file-item .delete-file-btn {
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    top: 3px;
    right: 3px;
  }

  .file-item .loader {
    width: 24px;
    height: 24px;
    border-width: 3px;
  }

  .file-item .file-name {
    font-size: 10px;
  }
}