/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

body {
  background-color: #f9fafb !important;
  color: #111827 !important;
  line-height: 1.6;
}

input[type="radio"] {
  accent-color: #e5254d;
}

/* Image Mapper Core */
.image-mapper {
  position: relative;
  user-select: none;
}

.image-mapper-img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.image-mapper-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Buttons */
button {
  cursor: pointer;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  outline: none!important;
}

.btn-success,
.btn-primary {
  background-color: transparent !important;
  color: #111827 !important;
  border: 1px solid #e8e8e8 !important;
  padding: 0.5rem 1rem;
}

.btn-success:hover,
.btn-primary:hover {
  background-color: #c41e44;
}

/* Containers & Cards */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem;
}

.step {
  background-color: #ffffff !important;
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.heading,
.step h1 {
  text-align: left;
  font-size: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-bottom: 3rem;
}

.segment {
  margin-bottom: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

/* Image Map Wrapper */
#image-map-wrapper {
  text-align: center;
}

#image-map-container {
  display: inline-block;
  border: 2px solid #ddd;
  padding: 0.5rem;
  border-radius: 0.5rem;
  max-width: 100%;
  background-color: #fff;
}

#image-map {
  display: inline-block;
  max-width: 100%;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th,
table td {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}

table th {
  background-color: #f3f4f6;
  font-weight: 600;
}

/* Inputs */
input,
select,
textarea {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e8e8e8;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  width: 100%;
  transition: border 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
	border-color: #e5254d !important;
	box-shadow: 0 0 0 1px #e5254d !important;
  outline: none;
}

/* File input */
#image-mapper-file {
  display: none;
}

/* Responsive Steps */
@media (max-width: 767px) {
  .step {
    text-align: center;
  }

  .step span {
    display: block;
    margin: 0.5rem 0;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #111827 !important;
    color: #f9fafb !important;
  }

  .modal-header,
  .modal-content,
  .modal-footer {
    background-color: #111827 !important;
  }

  .modal-header .close {
    color: #ffffff !important;
  }

  .step {
    background-color: #1f2937 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.6) !important;
  }

  #image-map-container {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
  }

  table th,
  table td {
    border-color: #374151 !important;
  }

  table th {
    background-color: #374151 !important;
  }

  input,
  select,
  textarea {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
  }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: #e5254d !important;
    box-shadow: 0 0 0 1px #e5254d !important;
  }

  .btn-success,
  .btn-primary {
    background-color: transparent !important;
    color: #ffffff !important;
  }

  .btn-success:hover,
  .btn-primary:hover {
    background-color: #c41e44 !important;
  }
}

/* Spinning icon */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#image-mapper-dialog .glyphicon-refresh {
  animation: spin 4s linear infinite;
}

#image-mapper-dialog .glyphicon-refresh {
	-webkit-animation-name: spin;
	-webkit-animation-duration: 4000ms;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: linear;
	-moz-animation-name: spin;
	-moz-animation-duration: 4000ms;
	-moz-animation-iteration-count: infinite;
	-moz-animation-timing-function: linear;
	-ms-animation-name: spin;
	-ms-animation-duration: 4000ms;
	-ms-animation-iteration-count: infinite;
	-ms-animation-timing-function: linear;
	animation-name: spin;
	animation-duration: 4000ms;
	animation-iteration-count: infinite;
	animation-timing-function: linear
}

@-ms-keyframes spin {
	from {
		-ms-transform: rotate(0deg)
	}

	to {
		-ms-transform: rotate(360deg)
	}
}

@-moz-keyframes spin {
	from {
		-moz-transform: rotate(0deg)
	}

	to {
		-moz-transform: rotate(360deg)
	}
}

@-webkit-keyframes spin {
	from {
		-webkit-transform: rotate(0deg)
	}

	to {
		-webkit-transform: rotate(360deg)
	}
}

@keyframes spin {
	from {
		transform: rotate(0deg)
	}

	to {
		transform: rotate(360deg)
	}
}