/* photo-bg-remove.css */

:root {
  --primary-color: #eb4c8e;
  --secondary-color: #ff8a00;
  --background-color: #0d0c1d;
  --surface-color: rgba(255, 255, 255, 0.05);
  --text-color: #ffffff;
  --muted-text-color: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --font-family: 'Inter', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 30px var(--shadow-color);
  text-align: center;
}

header {
  margin-bottom: 40px;
}

header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-color);
}

header p {
  color: var(--muted-text-color);
  max-width: 600px;
  margin: 0 auto;
}

.back-btn {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-decoration: none;
  border: 1px solid var(--primary-color);
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background-color: var(--primary-color);
  color: var(--text-color);
}

.upload-section {
  margin-bottom: 40px;
}

#image-input {
  display: none;
}

.upload-label {
  display: inline-block;
  padding: 40px 20px;
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 50%;
}

.upload-label:hover {
  border-color: var(--primary-color);
  background-color: rgba(235, 76, 142, 0.1);
}

.upload-label span {
  font-size: 18px;
  font-weight: 500;
}

.image-display-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.image-wrapper {
  position: relative;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-wrapper h2 {
  margin-bottom: 15px;
  font-size: 20px;
  color: var(--muted-text-color);
}

#original-image, #result-canvas {
  max-width: 100%;
  max-height: 400px;
  border-radius: 5px;
  object-fit: contain;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

button, .button {
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

button:hover, .button:hover {
  background-color: var(--secondary-color);
}

button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

#color-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#color-palette {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 10px;
}

.color-box {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.color-box:hover {
  border-color: var(--primary-color);
}

#color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 35px;
  height: 35px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}
#color-picker::-webkit-color-swatch {
  border-radius: 50%;
  border: 2px solid var(--border-color);
}
#color-picker::-moz-color-swatch {
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(13, 12, 29, 0.7);
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  backdrop-filter: blur(5px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.progress-bar-container {
  width: 80%;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  height: 10px;
  margin-bottom: 10px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  font-weight: 500;
}

footer {
  margin-top: 40px;
  color: var(--muted-text-color);
  font-size: 14px;
}

/* This class is toggled by JS to hide elements */
.hidden {
    display: none !important;
}

@media (max-width: 768px) {
  .image-display-section {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 20px;
  }
  header h1 {
    font-size: 28px;
  }
  .upload-label {
    padding: 30px 15px;
  }
  .upload-label span {
    font-size: 16px;
  }
}