﻿:root {
  --bg-light: #fdfdfd;
  --bg-dark: #1e1e1e;
  --text-light: #111;
  --text-dark: #f1f1f1;
  --card-bg-light: #fafafa;
  --card-bg-dark: #2c2c2c;
  --border-light: #ccc;
  --border-dark: #444;
  --accent: #007bff;
  --accent-dark: #3399ff;
  --danger: #e3342f;
}

/* Support dark mode */
body.dark .edit-form-container {
  background: var(--bg-dark);
  color: var(--text-dark);
}

body.dark input,
body.dark .product-form,
body.dark .link-form {
  background-color: var(--card-bg-dark);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

body.dark button {
  background: var(--accent-dark);
}

body.dark .remove-button {
  background-color: #cc1f1a;
}

/* Container and layout */
.edit-form-container {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-light);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease, color 0.3s ease;
}

  .edit-form-container h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
  }

  /* Inputs grid */
  .edit-form-container .grid input {
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    width: 100%;
    transition: border-color 0.3s;
  }

/* Sections */
.section {
  margin-top: 1.5rem;
}

  .section h3 {
    font-weight: bold;
    margin-bottom: 0.5rem;
  }

/* Image previews */
.image-preview {
  margin-top: 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #f8f8f8;
  padding: 6px;
}

.profile-image {
  width: 96px;
}

.banner-image {
  width: 300px;
}

.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

  .gallery-preview img {
    width: 80px;
    border: 1px solid #ccc;
    padding: 4px;
    background: #f8f8f8;
    border-radius: 4px;
  }

/* Reusable form blocks */
.link-form,
.product-form {
  border: 1px solid var(--border-light);
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background-color: var(--card-bg-light);
  transition: background 0.3s ease;
}

  .link-form input,
  .product-form input {
    padding: 8px;
    margin: 4px 6px 4px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: calc(50% - 8px);
    transition: all 0.3s ease;
  }

  .product-form .product-image {
    max-width: 120px;
    height: auto;
    object-fit: contain;
    display: block;
    margin-top: 6px;
    border: 1px solid #ccc;
    padding: 4px;
    background-color: #f8f8f8;
    border-radius: 4px;
  }

/* Buttons */
button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 8px 14px;
  margin-top: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

  button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
  }

  button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
  }

.remove-button {
  background: var(--danger);
  color: white;
  border: none;
  padding: 4px 10px;
  margin-left: 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

  .remove-button:hover {
    background-color: #cc1f1a;
  }

/* QR code preview */
.qr-preview img {
  width: 200px;
  margin-top: 20px;
}

/* Responsive layout */
@media (max-width: 768px) {
  .link-form input,
  .product-form input {
    width: 100%;
    margin-right: 0;
  }

  .gallery-preview {
    justify-content: center;
  }

  .banner-image {
    width: 100%;
    max-width: 100%;
  }

  .gallery-image-wrapper {
    position: relative;
    display: inline-block;
    margin: 5px;
  }

    .gallery-image-wrapper button {
      position: absolute;
      top: 4px;
      right: 4px;
      background: rgba(0, 0, 0, 0.6);
      color: white;
      border: none;
      border-radius: 50%;
      width: 24px;
      height: 24px;
      cursor: pointer;
    }

}
