

.modal-title {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title .task-title,
.task-title.modal-editable-title,
.modal-section .task-title {
  color: #ffffff !important;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
  margin: 0;
  display: block;
  width: 100%;
  transition: all 0.2s ease;
}

.modal-title .task-title {
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: 6px;
  cursor: text;
  padding-right: 52px;
}

.modal-title .task-title:hover {
  background: rgba(255, 255, 255, 0.03);
}

.modal-title .task-title:focus {
  background: rgba(255, 255, 255, 0.07) !important;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.modal-title-input {
  background: transparent !important;
  border: none !important;
  font-size: 1.5rem !important;
  font-weight: 600;
  color: var(--text-main);
  padding: 4px 0 !important;
  margin-right: 30px;
  width: calc(100% - 40px);
}


.close-btn,
.close-x {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #666;
}

.close-x {
  font-size: 1.5rem;
}






.modal-label {
  display: block;
  font-weight: 700;
  font-size: 0.7rem;
  color: #888e9b;
  margin-bottom: 10px;
  margin-top: 30px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}





.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-section {
  margin-bottom: 10px;
}

textarea.modal-description {
  width: 100%;
  min-height: 120px;
  background-color: #ffffff;
  border: 1px solid #dfe1e6;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
  resize: vertical;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modal-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

/* ===========================
   SUBTASKS
   =========================== */

.modal-subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 2px;
}

















.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  /* Centers container vertically */
  justify-content: center;
  /* Centers container horizontally */
  z-index: 9999;
  opacity: 0;
  visibility: hidden;

}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-color);
  height: 100svh;
  width: 100svw;
  max-width: 600px;
  height: 90svh;
  border-radius: var(--border-radius);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.3);
  position: relative;

  /* Crucial: Scale from the middle */
  transform-origin: center center;

  /* The 0.4s curve with a slight overshoot (1.56) makes it feel premium */
  transition: transform 0.4s cubic-bezier(0, 0, 1, 1);
  will-change: transform;
}

/* Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 0.1rem solid var(--sidebar-hover);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-main);
}

/* content */
.modal-content {
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  ;
  height: 100%;
  border-radius: 12px;
  padding: 40px;
  position: relative;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* The top-right [X]*/
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  margin: -10px;
  padding: 10px;
}

.modal-close:hover {
  color: var(--text-sub);
}

.modal-title:focus {
  background: white !important;

  padding: 4px 8px !important;
  border-radius: 3px;
}

.modal-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 8px;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- DELETE ACTION --- */
.modal-delete-task-row {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.modal-delete-task-btn {
  background: #ffe8e8;
  color: #dc2626;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.modal-delete-task-btn:hover {
  background: #ffb1b1 !important;
  color: white;
}


@media (max-width: 768px) {
  .modal-content {
    height: 100%;
    /* Take up full height */
    width: 100%;
    /* Take up full width */
    max-width: none;
    border-radius: 0;
    /* Remove rounded corners for full-screen feel */
    padding: 20px;
    /* Tighter padding for small screens */
  }

  .modal-close {
    top: 20px;
    right: 20px;
    font-size: 32px;
    /* Bigger tap target for fingers! */
  }
}