/* Custom styles for PersonalisedQR */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-bottom: 60px; /* Space for footer */
  position: relative;
  min-height: 100vh;
}

a {
  color: #00B7FF;
}

/* Center content on desktop */
@media (min-width: 992px) {
  .container {
    max-width: 1000px; /* As per requirement */
  }
}

/* Form styles */
.form-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background-color: #f9f9f9;
}

/* QR code display */
.qr-code-container {
  text-align: center;
  margin: 20px 0;
}

.qr-code-image {
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  background-color: white;
}

/* Sticky QR code preview */
.sticky-preview {
  position: sticky;
  top: 20px; /* Distance from the top of the viewport */
}

/* Image upload preview */
.image-preview {
  width: 200px;
  height: 200px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin: 10px 0;
  padding: 5px;
  background-color: white;
  object-fit: contain;
}

/* Image gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.image-item {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
  background-color: white;
}

.image-item img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

/* Dashboard cards */
.dashboard-card {
  height: 100%;
  transition: transform 0.3s;
}

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

/* Footer */
footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}

/* Alert styles */
.alert-success, .alert-danger {
  display: none;
}

.alert-success.show, .alert-danger.show {
  display: block;
}

/* Restore button styles */
.restore-button {
  position: relative;
  z-index: 20;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Ensure form elements are clickable */
form[action*="/undelete"] {
  position: relative;
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .form-container {
    padding: 15px;
    box-shadow: none;
    background-color: transparent;
  }

  /* On mobile, make the preview appear at the top before scrolling */
  .sticky-preview {
    position: relative;
    margin-bottom: 20px;
  }

  /* Reorder columns on mobile to show QR code first */
  .row {
    display: flex;
    flex-direction: column;
  }

  .col-md-4 {
    order: -1; /* Show this column first */
  }
}
