:root {
  --primary-color: #3a86ff;
  --secondary-color: #8338ec;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #666;
  --white: #fff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: #4285f4;
  color: var(--white);
  padding: 15px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-button {
  background-color: white;
  color: #333;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.header-button:hover {
  background-color: #f5f5f5;
}

main {
  flex: 1;
  padding: 30px 0;
}

section {
  margin-bottom: 40px;
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

h2 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

p {
  margin-bottom: 20px;
  color: var(--dark-gray);
}

.upload-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

input[type="file"] {
  display: none;
}

.upload-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}

.upload-button:hover {
  background-color: #2a75e6;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-item {
  position: relative;
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: move;
  transition: transform 0.2s, box-shadow 0.2s;
}

.image-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.image-item .image-number {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.image-item .remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 0, 0, 0.7);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-weight: bold;
}

.actions-section {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.primary-button,
.secondary-button {
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  border: none;
}

.primary-button {
  background-color: var(--primary-color);
  color: var(--white);
}

.primary-button:hover {
  background-color: #2a75e6;
}

.primary-button:disabled {
  background-color: var(--medium-gray);
  cursor: not-allowed;
}

.secondary-button {
  background-color: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.secondary-button:hover {
  background-color: #f0f7ff;
}

.secondary-button:disabled {
  border-color: var(--medium-gray);
  color: var(--dark-gray);
  cursor: not-allowed;
}

footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 20px 0;
  text-align: center;
  margin-top: auto;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

.loading-overlay p {
  color: white;
  margin-top: 20px;
}

.spinner {
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 5px solid white;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none;
}

/* Sortable styles */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .image-item img {
    height: 150px;
  }

  .actions-section {
    flex-direction: column;
  }

  header h1 {
    font-size: 24px;
  }
}
