/* Dialog Styles */
.dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  padding: 2rem;
  z-index: 1000;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow-y: auto;
}

.dialog::-webkit-scrollbar {
  width: 8px;
}

.dialog::-webkit-scrollbar-track {
  background: rgba(128, 128, 128, 0.1);
  border-radius: 4px;
}

.dialog::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.dialog.visible {
  display: block;
}

.dialog h2 {
  color: var(--active-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 1.8em;
}

.dialog h3 {
  color: var(--active-color);
  margin-top: 0;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dialog .form-group {
  margin-bottom: 1.5rem;
  background: rgba(128, 128, 128, 0.15);
  padding: 1.5rem;
  border-radius: calc(var(--border-radius) * 0.5);
  border: 1px solid rgba(128, 128, 128, 0.2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dialog .form-group:first-of-type {
  margin-bottom: 2rem;
  padding: 1rem;
}

.dialog .form-group:first-of-type .input-group {
  max-width: 300px;
  margin: 0 auto;
}

.dialog .input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  padding-right: 2.5rem;
}

.dialog .remove-child {
  position: absolute;
  right: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255, 68, 68, 0.6);
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog .remove-child:hover {
  color: #ff4444;
  transform: translateY(-50%) scale(1.1);
}

.dialog .remove-child:active {
  transform: translateY(-50%) scale(0.95);
}

.dialog .input-group {
  min-width: 0;
  width: 100%;
}

.dialog .input-group input[type="date"],
.dialog .input-group input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.dialog label {
  display: block;
  color: var(--active-color);
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.dialog input,
.dialog select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--active-color);
  border-radius: calc(var(--border-radius) * 0.5);
  font-size: 1em;
  transition: all 0.2s ease;
}

.dialog input:focus,
.dialog select:focus {
  outline: none;
  border-color: var(--special-color);
  box-shadow: 0 0 0 2px rgba(0, 212, 191, 0.2);
}

.dialog .children-container {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.dialog .child-entry {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--border-radius) * 0.5);
  background: rgba(128, 128, 128, 0.2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dialog .child-entry .input-group {
  width: 100%;
  min-width: 0;
}

.dialog .child-entry input[type="text"],
.dialog .child-entry input[type="date"] {
  width: 100%;
  box-sizing: border-box;
}

.dialog .child-entry .input-row {
  margin-bottom: 0;
}

.dialog .buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.dialog button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(to bottom, 
    rgba(128, 128, 128, 0.2),
    rgba(128, 128, 128, 0.1)
  );
  border: 1px solid var(--border-color);
  color: var(--active-color);
  cursor: pointer;
  border-radius: calc(var(--border-radius) * 0.5);
  font-weight: bold;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dialog button:hover {
  background: linear-gradient(to bottom,
    var(--active-color),
    rgba(255, 255, 255, 0.8)
  );
  color: var(--bg-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dialog button:active {
  transform: translateY(1px);
  box-shadow: none;
}

#generateUrl {
  background: linear-gradient(to bottom,
    rgba(0, 212, 191, 0.3),
    rgba(0, 212, 191, 0.2)
  );
  border-color: var(--special-color);
}

#generateUrl:hover {
  background: linear-gradient(to bottom,
    var(--special-color),
    rgba(0, 212, 191, 0.8)
  );
}

.dialog .url-output {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(128, 128, 128, 0.15);
  border-radius: calc(var(--border-radius) * 0.5);
  border: 1px solid rgba(128, 128, 128, 0.2);
}

.dialog .url-output label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--active-color);
}

.dialog .url-output input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--active-color);
  cursor: pointer;
}

.dialog .url-output .copy-hint {
  color: var(--special-color);
  font-size: 0.8em;
  margin-top: 0.5rem;
  text-align: right;
}

.dialog .error {
  color: #ff4444;
  margin-top: 0.5rem;
  font-size: 0.9em;
  padding: 0.5rem;
  background: rgba(255, 68, 68, 0.1);
  border-radius: calc(var(--border-radius) * 0.5);
  text-shadow: none;
}

.dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.dialog-overlay.visible {
  display: block;
}

.dialog select {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

/* Mac 1984 theme specific modal styles */
.mac1984 .dialog {
  background: var(--window-bg);
  border: 2px solid var(--border-color);
  box-shadow: none;
}

.mac1984 .dialog input,
.mac1984 .dialog select,
.mac1984 .dialog button {
  background: var(--window-bg);
  border: 2px solid var(--border-color);
}

.mac1984 .dialog select {
  color: black;
  background-color: white;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.8em;
  padding-right: 2rem;
}

.mac1984 .dialog .form-group:first-of-type {
  background: var(--window-bg);
  border: 2px solid var(--border-color);
  padding: 0.75rem;
}

/* Days Until Dialog specific styles */
.days-until-list {
  margin-bottom: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.days-until-item {
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(128, 128, 128, 0.15);
  border-radius: calc(var(--border-radius) * 0.5);
  border: 1px solid rgba(128, 128, 128, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.days-until-item:last-child {
  margin-bottom: 0;
}

.days-until-item .event-name {
  color: var(--active-color);
  font-weight: 500;
}

.days-until-item .days-count {
  color: var(--special-color);
  font-weight: bold;
  padding-left: 1rem;
}
