:root {
  /* Dark theme (default) */
  --bg-primary: #0b1622;
  --text-tertiary: #9fadbd;
  --text-light: #e0e0e0;
  --text-dark: #333;
  --text-label: #728ab1;
  --text-muted: #666;
  --text-close: #666;
  --modal-bg: #151f2e;
  --button-primary: #3db4f2;
  --button-primary-hover: #0056b3;
  --button-cancel: #6c757d;
  --button-cancel-hover: #5a6268;
  --button-danger: #e74c3c;
  --close-hover-bg: #eee;
  --close-hover-text: #222;
}

[data-theme="light"] {
  --bg-primary: #e7f0f8;
  --text-tertiary: #0b5f97;
  --text-light: #ffffff;
  --text-dark: #07375a;
  --text-label: #0b5f97;
  --text-muted: #0b5f97;
  --text-close: #0b5f97;
  --modal-bg: #DCECF8;
  --button-primary: #3db4f2;
  --button-primary-hover: #0056b3;
  --button-cancel: #6c757d;
  --button-cancel-hover: #5a6268;
  --button-danger: #dc3545;
  --close-hover-bg: #cfe8f7;
  --close-hover-text: #0b5f97;
}

[data-theme="brown"] {
  --bg-primary: #271c19;
  --text-tertiary: #faeee7;
  --text-light: #faeee7;
  --text-dark: #d39f82;
  --text-label: #faeee7;
  --text-muted: #faeee7;
  --text-close: #faeee7;
  --modal-bg: #55423d;
  --button-primary: #8f5b4d;
  --button-primary-hover: #aa6d5c;
  --button-cancel: #6c757d;
  --button-cancel-hover: #5a6268;
  --button-danger: #dc3545;
  --close-hover-bg: #f8f9fa;
  --close-hover-text: #495057;
}

.rating-stars {
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: var(--bg-primary);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}

.star {
  font-size: 1.5rem;
  color: #bbb;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  line-height: 0.9;
  vertical-align: middle;
  display: inline-block;
}
.star.selected {
  color: #FFD600;
  text-shadow: 0 1px 4px #ffecb3;
}
.star:hover,
.star:focus {
  color: #FFC107;
  outline: none;
}

.rating-number input[type="number"] {
  width: 70px;
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-primary);
  text-align: center;
  outline: none;
  margin-left: 2px;
  height: 2rem;
  width: 8rem;
}
.rating-number input[type="number"]:focus {
  border-color: var(--button-primary);
}
/* Utility class to hide modal elements specifically */
.modal-hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Overlay behind the modal to darken the page */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 20000; /* Raised above search overlay */
  opacity: 1;
  transition: opacity 0.3s ease;
  animation: modalFade 0.25s ease-in-out forwards;
}

@keyframes modalFade {
  0% {
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}


/* Modal container centered on screen */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20001;
  background: var(--modal-bg);
  border-radius: 16px;
  max-width: 820px;
  width: 95%;
  box-sizing: border-box;
  overflow: auto;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 0;
  animation: modalPop 0.25s ease-in-out;
  transform-origin: center center;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}


/* Content wrapper inside modal */
.modal-content {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

/* Banner at top of modal */
.modal-banner {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.modal-banner {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.modal-banner .banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0));
  z-index: 1;
}

.modal-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45); /* consistent dark tint */
  z-index: 0;
}


/* Cover image in top-right of banner */
.modal-cover {
  position: absolute;
  top: 70px;       /* Adjust to overlap banner and body */
  left: 30px;       /* Move to left side */
  width: 120px;
  height: 170px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.modal-cover img {
  width: 100%;
  height: 100%;

  overflow:hidden;
}

/* Special case for music */
.modal-cover[data-media-type="music"] {
  width: 140px;       /* container stays same */
  height: 140px;      /* square for music */
  overflow: hidden;
  top: 90px;       /* Adjust to overlap banner and body */
  left: 15px;
}

.modal-cover[data-media-type="music"] img {
  width: 200px;       /* zoom in by increasing image width */
  height: 140px;      /* match container height */
  object-fit: cover;
  object-position: center;  /* adjust to shift left/right */
  position: relative;
  left: -1.9rem;        /* shift image left to center the zoomed portion */
  display: block;
}

.modal-title-block {
  position: absolute;
  top: 160px;              /* Align with cover */
  left: 170px;            /* To the right of the 120px wide cover + spacing */
  z-index: 10;
  max-width: 520px;
  color: rgb(224, 223, 223);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--text-light);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Body below banner */
.modal-body {
  padding: 1.5rem 2rem 2rem 2rem;
}

/* Form group with label and input */
.form-group {
  display: flex;
  flex-direction: column; /* Stack label + input inside */
  margin-bottom: 1rem;
  width: 100%;
  max-width: 250px; /* controls how wide each one is in the row */
}

/* Label takes fixed width, right-aligned */
.form-group label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-label);
  text-align: left;
  user-select: none;
}

/* Inputs, selects, textarea */
.form-group input,
.form-group select,
.form-group textarea {
  flex: 1;
  max-width: 300px;
  padding: 0.35rem 0.5rem;
  border: 0;
  box-shadow: 0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background-color: var(--bg-primary);
  color: var(--text-tertiary);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #007bff;

}



/* Buttons container */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

.modal-body form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 12rem;
}

/* General button styles */
.btn {
  background-color: var(--button-primary);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover,
.btn:focus {
  background-color: var(--button-primary-hover);
  box-shadow: none;
  outline: none;
}

/* Cancel button variant */
.btn.cancel {
  background-color: var(--button-cancel);
  box-shadow: 0 3px 7px rgba(108, 117, 125, 0.4);
}

.btn.cancel:hover,
.btn.cancel:focus {
  background-color: var(--button-cancel-hover);
  box-shadow: 0 5px 15px rgba(90, 98, 104, 0.6);
  outline: none;
}

/* Close button positioned top-right inside modal */
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  color: var(--text-close);
  font-weight: 700;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  border-radius: 6px;
  transition: background-color 0.25s ease, color 0.25s ease;
  user-select: none;
  z-index: 20;
}

.close-btn:hover,
.close-btn:focus {
  background-color: var(--close-hover-bg);
  color: var(--close-hover-text);
  outline: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

/* Danger button (e.g., delete) */
.danger-btn {
  background-color: var(--bg-primary);
  color: var(--text-tertiary);
  display: block;
  margin-left: auto;
  margin-right: 1.5rem;
  margin-top: 1.5rem;
  width: fit-content;
}

.danger-btn:hover {
  background-color: var(--button-danger);
  color: white;
  box-shadow: none;
}

.modal-actions-top {
  position: absolute;
  top: 150px;     /* adjust vertical position */
  right: 60px;   /* adjust horizontal position */
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.modal-actions-top .favorite-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.edit-favorite-wrapper {
  display: flex;
  align-items: center;
  gap: 12px; /* space between heart and Save */
}

.favorite-checkbox {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #555;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hide native checkbox */
.favorite-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Unchecked: solid white heart with no stroke */
.favorite-checkbox .heart {
  width: 40px;
  height: 40px;
  display: inline-block;
  background: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" stroke="%23ffffff" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 21C12 21 7 16.5 5 12.5C3 8.5 5 5 8.5 5C10.5 5 12 7 12 7C12 7 13.5 5 15.5 5C19 5 21 8.5 19 12.5C17 16.5 12 21 12 21Z"/></svg>') no-repeat center center;
  background-size: contain;
  transition: background 0.3s ease;
}

/* Red heart when checked */
.favorite-checkbox input[type="checkbox"]:checked + .heart {
  background: url('data:image/svg+xml;utf8,<svg fill="%23e0245e" stroke="%23e0245e" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 21C12 21 7 16.5 5 12.5C3 8.5 5 5 8.5 5C10.5 5 12 7 12 7C12 7 13.5 5 15.5 5C19 5 21 8.5 19 12.5C17 16.5 12 21 12 21Z"/></svg>') no-repeat center center;
  background-size: contain;
}

/* Hover effect for unchecked heart (grey/white) */
.favorite-checkbox .heart:hover {
  filter: drop-shadow(0 0 4px #fff) brightness(1.2);
  cursor: pointer;
}

/* Hover effect for checked heart (red) */
.favorite-checkbox input[type="checkbox"]:checked + .heart:hover {
  filter: drop-shadow(0 0 6px #e0245e) brightness(1.1);
  cursor: pointer;
}

.form-row-two {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
  max-width: 600px;
  margin-bottom: 1.2rem;
}

.form-group:first-child {
  margin-right: -2rem;
}

.form-group.vertical-label {
  flex-direction: column;
  align-items: flex-start;
}

.form-group.vertical-label label {
  flex: none;
  margin-right: 0;
  margin-bottom: 0.3rem;
  text-align: left;
}

#progress_main_group label,
#progress_secondary_group label,
#date_added_group label,
#repeats_group label {
  gap: 0.25rem; /* tightens spacing between items inside label */
  display: flex;
  flex-direction: column;
  width: 150px; /* or any specific value you prefer */
  max-width: 100%;
}

#date_added_group,
#repeats_group {
  max-width: 218px;
}

#repeats{
  width: 135px;
}

.progress-total-display {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group label {
  display: block;
  margin-bottom: 0.25em;
  color: var(--text-label);
}

textarea[name="notes"] {
  flex: none;
  min-height: 50px;   /* less tall */
  width: 100%;        /* full width */
  height: auto;
  max-width: 600px;   /* wider */
  resize:vertical;
  max-height: 231px;

  scrollbar-width: none; /* for Firefox */
  -ms-overflow-style: none;  /* for IE and Edge */
}

textarea[name="notes"]::-webkit-scrollbar {
  display: none;
}

.form-group.notes-group {
  max-width: 350px; /* wider max-width just for notes */
  width: 100%;
}

.rating-faces {
  display: flex;
  gap: 10px;
}

.face {
  width: 30px;
  height: 30px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: 50%;
  border: 1px solid transparent;
  background-color: transparent;
  transition: border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Sad face */
.face-bad {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%23777777" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm170.2 218.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320s86.3 19.6 114.7 53.8c13.6 16.2-11 36.7-24.5 20.4z"/></svg>');
}

/* Neutral face */
.face-neutral {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%23777777" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm-80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm176 192H152c-21.2 0-21.2-32 0-32h192c21.2 0 21.2 32 0 32zm-16-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"/></svg>');
}

/* Happy face */
.face-good {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%23777777" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"/></svg>');
}


/* Selected (pink background) versions */

.face.selected.face-bad {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%23e53935" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm170.2 218.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320s86.3 19.6 114.7 53.8c13.6 16.2-11 36.7-24.5 20.4z"/></svg>');
  color: #E53935;
}

.face.selected.face-neutral {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%23fbc02d" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm-80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm176 192H152c-21.2 0-21.2-32 0-32h192c21.2 0 21.2 32 0 32zm-16-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"/></svg>');
  color: #FBC02D;
}

.face.selected.face-good {
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 496 496" xmlns="http://www.w3.org/2000/svg"><path fill="%234caf50" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"/></svg>');
  color: #4CAF50;
}

.face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0);
  transition: background-color 0.2s ease;
}

.face:hover {
  filter: brightness(1.2);
}


.rating-faces {
  display: flex;
  gap: 25px;
  padding: 4px 7px;
  border-radius: 10px;
  justify-content: center;
  border: 0;
  background-color: var(--bg-primary);
}
.rating-faces.modal-hidden {
  display: none !important;
  padding: 0 !important;
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

#status,
.status-select {
  min-width: 150px; /* or any width you want */
  max-width: none;  /* override the default max-width */
  border: none; /* removes the border around the select input */
  outline: none; /* removes focus outline */
}

