:root {
  --primary: #5d5cde;
  --primary-dark: #4847b8;
}

body {
  transition: background-color 0.2s, color 0.2s;
}

.dark-mode {
  background-color: #212529;
  color: #f8f9fa;
}

.dark-mode .card,
.dark-mode .bg-light {
  background-color: #343a40 !important;
  color: #f8f9fa;
}

.dark-mode .form-control,
.dark-mode .form-select {
  background-color: #495057;
  color: #f8f9fa;
  border-color: #6c757d;
}

.dark-mode .nav-tabs .nav-link {
  color: #f8f9fa;
}

.dark-mode .nav-tabs .nav-link.active {
  background-color: #343a40;
  color: var(--primary);
  border-color: #495057;
}

.dark-mode .border-bottom {
  border-color: #495057 !important;
}

.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);
}

.text-primary {
  color: var(--primary) !important;
}

/* Preset backgrounds */
.bg-preset-1 {
  background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
}
.bg-preset-2 {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}
.bg-preset-3 {
  background: linear-gradient(135deg, #13547a 0%, #80d0c7 100%);
}
.bg-preset-4 {
  background: linear-gradient(to right, #c6ffdd, #fbd786, #f7797d);
}
.bg-preset-5 {
  background: linear-gradient(to right, #2c3e50, #4ca1af);
}
.bg-preset-6 {
  background: linear-gradient(to right, #000428, #004e92);
}
.bg-preset-7 {
  background-color: #000;
  background-image: radial-gradient(#333 1px, transparent 0);
  background-size: 20px 20px;
}
.bg-preset-8 {
  background-color: #f9f9f9;
  background-image: radial-gradient(#ccc 1px, transparent 0);
  background-size: 20px 20px;
}

.book-cover {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  background-size: cover;
  background-position: center;
}
.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 7%;
  background: rgba(0, 0, 0, 0.1);
}

.dark-mode .book-spine {
  background: rgba(255, 255, 255, 0.1);
}

.text-element {
  position: absolute;
  cursor: move;
  padding: 5px;
  border: 2px solid transparent;
  z-index: 10;
  transition: border 0.2s;
}

.text-element:hover {
  border: 2px dashed var(--primary);
}

.dark-mode .text-element:hover {
  border: 2px dashed #8483ff;
}

.drop-zone {
  border: 2px dashed #ced4da;
  border-radius: 0.25rem;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.3s ease;
}

.drop-zone--over {
  border-color: var(--primary);
}

.drop-zone__prompt {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
}

.dark-mode .drop-zone__prompt {
  color: #e2e8f0;
}

.drop-zone__input {
  display: none;
}

.resizer {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--primary);
  border-radius: 50%;
  z-index: 20;
}

.resizer-sw {
  bottom: -5px;
  left: -5px;
  cursor: sw-resize;
}

.resizer-se {
  bottom: -5px;
  right: -5px;
  cursor: se-resize;
}

.resizer-nw {
  top: -5px;
  left: -5px;
  cursor: nw-resize;
}

.resizer-ne {
  top: -5px;
  right: -5px;
  cursor: ne-resize;
}

.bg-preset-option {
  height: 60px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.bg-preset-option:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tab-content {
  padding-top: 1rem;
}

.drop-zone__thumb {
  width: 100%;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
  background-size: cover;
  position: relative;
}

.drop-zone__thumb::after {
  content: attr(data-label);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 5px 0;
  color: white;
  background: rgba(0, 0, 0, 0.75);
  font-size: 14px;
  text-align: center;
}