/* Main styling for the photo uploading and cropping interface */

:root {
  /* Color system */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #4b5563;
  --secondary-light: #9ca3af;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --light: #f3f4f6;
  --dark: #1f2937;
  --white: #ffffff;
  --body-bg: #f9fafb;
  --border-color: #e5e7eb;

  /* Typography */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 1rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Spacing */
  --spacer: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Border radius */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
}

/* Global styles */
body {
  font-family: var(--font-family-base);
  background-color: var(--body-bg);
  color: var(--dark);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* Typography enhancements */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--dark);
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

.text-muted {
  color: var(--secondary-light) !important;
}

/* Navbar customization */
.navbar {
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: var(--font-weight-bold);
}

.navbar-dark {
  background-color: var(--dark) !important;
}

/* Card styling */
.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: var(--font-weight-medium);
}

.card-footer {
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
}

/* Button styling */
.btn {
  font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-secondary {
  color: var(--secondary);
  border-color: var(--secondary-light);
}

.btn-outline-secondary:hover {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
}

/* Form controls */
.form-control {
  border-radius: var(--border-radius);
  border-color: var(--border-color);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.form-label {
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.5rem;
}

.form-select {
  border-radius: var(--border-radius);
  border-color: var(--border-color);
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  background-position: right 0.75rem center;
}

.form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* Tables */
.table {
  border-color: var(--border-color);
}

.table th {
  font-weight: var(--font-weight-medium);
  background-color: var(--light);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-sm);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-dark);
}

.alert-secondary {
  background-color: rgba(75, 85, 99, 0.1);
  color: var(--secondary);
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Image grid improvements */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

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

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

/* File input styling */
.file-input-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
}

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--white);
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-input-label:hover {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.file-input-label svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--primary);
}

.file-input-label span {
  font-weight: var(--font-weight-medium);
  color: var(--secondary);
}

.file-input-label small {
  color: var(--secondary-light);
  margin-top: 0.5rem;
}

.file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* Crop container improvements */
.crop-container {
  position: relative;
  border: 1px solid var(--border-color);
  background-color: var(--white);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crop-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.crop-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Delete button restyling */
.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  font-size: 1rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--danger);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.9;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Crop controls styling improvements */
.crop-controls-wrapper {
  margin: 0.75rem 0.75rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: auto;
}

/* Card footer adjustments */
.card-footer {
  padding: 0 !important;
  border: none !important;
  background-color: transparent !important;
}

/* Orientation button group - first row */
.orientation-btn-group {
  display: flex;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Reset button - second row */
.reset-btn-container {
  width: 100%;
  margin-top: 0.375rem;
}

/* Equal width buttons in orientation group */
.orientation-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--border-radius);
}

/* Reset button styling */
.reset-btn {
  width: 100%;
  padding: 0.6rem 0.5rem;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

/* Left button in orientation group */
.orientation-btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Right button in orientation group */
.orientation-btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

/* Active state styling */
.orientation-btn.active, .reset-btn.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Hover state styling */
.orientation-btn:hover:not(.active), .reset-btn:hover {
  background-color: var(--light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Button with icon styling */
.orientation-btn .icon, .reset-btn .icon {
  width: 16px;
  height: 16px;
}

/* Card styling improvements */
.image-preview-item .card {
  overflow: visible;
  border-radius: 8px;
}

/* Enhance shadow when hovering over entire card */
.image-preview-item .card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

/* Make the image container have same radius as card */
.crop-container {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Responsive styles */
@media (max-width: 576px) {
  .orientation-btn, .reset-btn {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
  }

  .orientation-btn .icon, .reset-btn .icon {
    width: 14px;
    height: 14px;
  }

  .crop-controls-wrapper {
    margin: 0.5rem 0.5rem 0.75rem 0.5rem;
    gap: 0.3rem;
  }
}

/* Hidden radio inputs */
.crop-radio {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* File name styling */
.image-preview-item .text-truncate {
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--secondary);
  font-size: 0.8rem;
}

/* Progress bar */
.progress {
  height: 0.75rem;
  border-radius: var(--border-radius-lg);
  background-color: var(--light);
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  background-color: var(--primary);
  transition: width 0.3s ease;
}

/* Modal styling */
.modal-content {
  border-radius: var(--border-radius-md);
  border: none;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--white);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--white);
}

/* Gallery thumb improvements */
.gallery-thumb {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  cursor: zoom-in;
}

.gallery-thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.05);
}

.gallery-thumb.selected {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Package selection styling */
.pkg-label.btn {
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  font-weight: var(--font-weight-normal);
  text-align: left;
}

.pkg-label.btn-outline-secondary {
  border-color: var(--border-color);
}

.pkg-label.btn-secondary {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Price info badge */
#price-info {
  background-color: var(--light);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

/* Status alert styling */
#status {
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

#status:empty {
  display: none;
}

/* Payment form styling */
#payment-form {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}

#card-element {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--white);
  margin-bottom: 1rem;
}

/* Cropper.js custom styling */
.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  touch-action: none;
  user-select: none;
}

.cropper-container img {
  display: block;
  height: auto;
  image-orientation: 0deg;
  max-height: none !important;
  max-width: none !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100%;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  background-color: #000;
  opacity: 0.5;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 1px solid #39f;
  outline-color: rgba(51, 153, 255, 0.75);
  overflow: hidden;
  width: 100%;
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
  border-bottom-width: 1px;
  border-top-width: 1px;
  height: calc(100% / 3);
  left: 0;
  top: calc(100% / 3);
  width: 100%;
}

.cropper-dashed.dashed-v {
  border-left-width: 1px;
  border-right-width: 1px;
  height: 100%;
  left: calc(100% / 3);
  top: 0;
  width: calc(100% / 3);
}

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
.cropper-center::after {
  background-color: #eee;
  content: ' ';
  display: block;
  position: absolute;
}

.cropper-center::before {
  height: 1px;
  left: -3px;
  top: 0;
  width: 7px;
}

.cropper-center::after {
  height: 7px;
  left: 0;
  top: -3px;
  width: 1px;
}

/* Improved orientation buttons */
.orientation-btn-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.orientation-btn {
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background-color: white;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}

.orientation-btn svg,
.orientation-btn .icon {
  width: 20px;
  height: 20px;
}

.orientation-btn.active {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
  box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

.orientation-btn:hover:not(.active) {
  background-color: #f8f9fa;
  border-color: #0d6efd;
  transform: translateY(-2px);
}

.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background-color: white;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
  font-weight: 500;
}

.reset-btn:hover {
  background-color: #f8f9fa;
  color: #dc3545;
  border-color: #dc3545;
  transform: translateY(-2px);
}

#modal-param-container {
  margin-top: 15px;
  padding: 15px;
  border-radius: 6px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
}

/* Crop image preview improvements */
.image-preview-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.img-preview {
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
}

/* Gallery specific styling */
.gallery-item {
  transition: all 0.3s ease;
}

.gallery-card {
  box-shadow: var(--shadow);
  border: none;
  transition: all 0.3s ease;
  height: 100%;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-thumb:hover .gallery-overlay {
  opacity: 1;
}

.zoom-icon {
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image preview styling */
.image-preview-item {
  margin-bottom: 1.5rem;
}

/* Modal navigation controls */
#nav-left, #nav-right {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

#nav-left:hover, #nav-right:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

#modalImage {
  max-height: 75vh;
  object-fit: contain;
}

/* Selection summary */
#selection-summary {
  font-size: 0.9rem;
  padding: 0.75rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: var(--border-radius);
  margin-top: 0.5rem;
}

/* Package counts */
.pkg-count {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background-color: var(--light);
  border-radius: 999px;
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* Cropper Modal */
.cropper-container-modal {
  height: 60vh;
  min-height: 400px;
  width: 100%;
  background-color: #f8f9fa;
  overflow: hidden;
  position: relative;
}

.cropper-container-modal img {
  display: block;
  max-width: 100%;
}

/* Ensure the cropper container in the modal is properly sized */
.cropper-container-modal .cropper-container {
  height: 100% !important;
  width: 100% !important;
}

/* Make the thumbnails look clickable */
.crop-container.clickable {
  cursor: pointer;
  position: relative;
  background-color: #f8f9fa;
  transition: background-color 0.2s ease, transform 0.2s ease;
  overflow: hidden;
  height: 200px;
}

.crop-container.clickable:hover {
  background-color: #e9ecef;
  transform: scale(1.02);
}

/* Add overlay hint for clickable thumbnails */
.crop-container.clickable::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M3.5.5A.5.5 0 0 1 4 1v13h13a.5.5 0 0 1 0 1h-2v2a.5.5 0 0 1-1 0v-2H3.5a.5.5 0 0 1-.5-.5V4H1a.5.5 0 0 1 0-1h2V1a.5.5 0 0 1 .5-.5zm2.5 3a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4H6.5a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.crop-container.clickable:hover::after {
  opacity: 0.8;
}

/* Edit button styling */
.image-preview-item .btn-outline-primary {
  margin-top: 0.5rem;
}

/* Custom parameter indicator */
.param-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--white);
  border-radius: 50%;
  cursor: help;
  opacity: 0.85;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.param-indicator svg {
  width: 14px;
  height: 14px;
}

.param-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Modal parameter container styling */
#modal-param-container {
  background-color: var(--light);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 1rem;
  margin-top: 1rem;
}

#modal-param-container h6 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

#modal-param-container h6::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232563eb' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M11.5 2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3M9.05 3a2.5 2.5 0 0 1 4.9 0H16v1h-2.05a2.5 2.5 0 0 1-4.9 0H0V3h9.05zM4.05 8a2.5 2.5 0 0 1 4.9 0H16v1H8.95a2.5 2.5 0 0 1-4.9 0H0V8h4.05z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.modal-parameter-select {
  border-color: var(--border-color);
  transition: all 0.2s ease;
}

.modal-parameter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.25);
}

#modal-param-container .form-group {
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s ease;
}

#modal-param-container .form-group:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

/* Crop area indicator styles */
.crop-area-indicator {
  position: absolute;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  z-index: 2;
  pointer-events: none;
}

/* Add corner handles to make it look like a crop frame */
.crop-area-indicator::before,
.crop-area-indicator::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--white);
  z-index: 3;
}

.crop-area-indicator::before {
  top: -5px;
  left: -5px;
  border-right: none;
  border-bottom: none;
}

.crop-area-indicator::after {
  bottom: -5px;
  right: -5px;
  border-left: none;
  border-top: none;
}

/* Thumbnail image container positioning */
.crop-container {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-container .crop-img {
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  position: relative;
  z-index: 1;
}

/* Image loading and error indicators */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.image-error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 10px 15px;
  border-radius: 4px;
  border-left: 3px solid #dc3545;
  color: #dc3545;
  font-weight: bold;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  border-radius: 4px;
  border-left: 4px solid #dc3545;
  color: #dc3545;
  font-weight: bold;
  min-width: 250px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Preview item styling */
.preview-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-image-container {
  flex: 1;
  background: #f8f9fa;
}

.preview-content {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.preview-image {
  height: 360px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background-color 0.2s;
  z-index: 2;
}

.preview-content:hover .preview-overlay {
  background-color: rgba(0,0,0,0.05);
}

.preview-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.preview-duplicate-btn,
.preview-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: white;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s;
}

.preview-duplicate-btn:hover {
  background: #f8f9fa;
  color: #0d6efd;
  border-color: #0d6efd;
}

.preview-delete-btn:hover {
  background: #f8f9fa;
  color: #dc3545;
  border-color: #dc3545;
}

.preview-delete-btn {
  font-size: 20px;
}

.preview-info {
  border-top: 1px solid #eee;
  background: white;
  padding: 8px;
  flex-shrink: 0;
}

.preview-format {
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* Crop area indicator */
.crop-indicator {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 400px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: all 0.2s;
  z-index: 2;
}
