/* ================================
   ESTILOS GENERALES
================================ */
body {
  font-family: 'PT Sans', sans-serif;
  margin: 0;
  padding: 0;
  background: #282a36;
  color: #f8f8f2;
  transition: background 0.3s, color 0.3s;
}

/* ================================
   HEADER
================================ */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #44475a;
  padding: 14px 24px;
  color: #f8f8f2;
  box-shadow: 0 2px 8px rgba(40, 42, 54, 0.5);
}

.header-controls {
  display: flex;
  align-items: center;
}

#searchTask {
  padding: 7px 12px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  outline: none;
  background: #343746;
  color: #f8f8f2;
}

.search-btn {
  margin-left: 8px;
  padding: 7px 16px;
  background: #6272a4;
  color: #f8f8f2;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.search-btn:hover {
  background: #bd93f9;
  color: #282a36;
}

.logo-header .logo-img {
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(40, 42, 54, 0.3);
}

/* ================================
   BOARD Y LISTAS
================================ */
.board {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
}

.list {
  background: #343746;
  min-width: 220px;
  flex: 1;
  margin-bottom: 24px;
  padding: 8px;
  color: #f8f8f2;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(10,35,66,0.18);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
}

.column-header h2 {
  font-size: 18px;
  margin: 0;
  padding: 4px 0;
  color: #00eaff;
  cursor: pointer;
  text-align: center;
  flex: 1;
}

.tasks {
  min-height: 50px;
  margin-top: 8px;
  padding: 0 4px;
}

.add-task {
  background: #6272a4;
  color: #f8f8f2;
  border: none;
  border-radius: 0 0 6px 6px;
  padding: 8px;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}
.add-task:hover {
  background: #bd93f9;
  color: #282a36;
}

.add-column {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: #00eaff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(10,35,66,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  transition: background 0.2s, box-shadow 0.2s;
  border: none;
  padding: 0;
}
.add-column img {
  width: 28px;
  height: 28px;
  pointer-events: none;
}
.add-column:hover {
  background: #50fa7b;
  box-shadow: 0 6px 24px rgba(0,234,255,0.25);
}

.delete-column-btn {
  background: none;
  border: none;
  color: #ff5555;
  font-size: 22px;
  cursor: pointer;
  margin-left: 8px;
  transition: color 0.2s;
}
.delete-column-btn:hover {
  color: #ff2222;
}

/* ================================
   MODAL DE TAREAS
================================ */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #343746;
  margin: 40px auto;
  padding: 48px 56px;
  border-radius: 18px;
  width: 98vw;
  max-width: 1200px;
  box-shadow: 0 8px 32px rgba(40,42,54,0.35);
  color: #f8f8f2;
  display: flex;
  flex-direction: column;
  gap: 32px;
  justify-content: center;
  align-items: stretch;
  animation: modalFadeIn 0.25s;
}

/* ================================
   MODAL GRID – ESTRUCTURA CON GRID
================================ */
.modal-grid {
  display: flex;
  gap: 36px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.main-fields {
  width: 33.3%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: flex-start;
}

.subtasks-fields {
  width: 33.3%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.progress-fields {
  width: 33.3%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ================================
   ACCIONES DEL MODAL
================================ */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 12px;
}

/* ================================
   INPUTS, TEXTAREAS Y SELECTS
================================ */
input,
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #44475a;
  background: #282a36;
  color: #f8f8f2;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 15px;
  resize: none;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  color: #00eaff;
  font-weight: bold;
}

/* ================================
   TITULOS Y SUBTITULOS
================================ */
h2,
h3 {
  color: #00eaff;
  text-align: left;
  margin-bottom: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* ================================
   BARRA DE PROGRESO
================================ */
.progress-bar {
  background: #44475a;
  border-radius: 5px;
  overflow: hidden;
  height: 20px;
  margin-bottom: 8px;
  position: relative;
  min-width: 120px;
}
.progress-fill {
  background: #00eaff;
  height: 100%;
  width: 0%;
  transition: width 0.3s;
}
#progressPercentage {
  position: absolute;
  right: 10px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #00eaff;
  font-weight: bold;
}

/* ================================
   SUBTAREAS
================================ */
.subtask-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.subtask-row input[type="text"] {
  flex: 1;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid #44475a;
  font-size: 14px;
  background: #282a36;
  color: #f8f8f2;
}
.subtask-row input[type="checkbox"] {
  accent-color: #00eaff;
}
.subtask-row button {
  background: none;
  border: none;
  color: #ff5555;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}
.subtask-row button:hover {
  color: #ff2222;
}
.subtask-row textarea.subtask-textarea {
    resize: vertical;
    min-height: 32px;
    max-height: 80px;
    background: #282a36;
    color: #f8f8f2;
    border: 1px solid #44475a;
    border-radius: 4px;
    font-size: 14px;
    margin: 0 6px;
}

/* ================================
   BOTONES DE ACCIÓN
================================ */
.btn-save,
.btn-delete,
.btn-cancel,
.btn-subtask {
  padding: 10px 18px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
}
.btn-save {
  background: #00eaff;
  color: #23243a;
}
.btn-save:hover {
  background: #50fa7b;
  color: #23243a;
}
.btn-delete {
  background: #ff5555;
  color: #f8f8f2;
}
.btn-delete:hover {
  background: #ff2222;
}
.btn-cancel {
  background: #6272a4;
  color: #f8f8f2;
}
.btn-cancel:hover {
  background: #44475a;
}
.btn-subtask {
  background: #00eaff;
  color: #23243a;
  margin-top: 8px;
  width: 100%;
}
.btn-subtask:hover {
  background: #50fa7b;
  color: #23243a;
}

/* ================================
   RESPONSIVIDAD
================================ */
@media (max-width: 1100px) {
  .board {
    flex-wrap: wrap;
    gap: 16px;
  }
  .list {
    width: 100%;
    min-width: 220px;
    margin-bottom: 24px;
  }
  .modal-content {
    padding: 18px 8px;
  }
  .modal-grid {
    flex-direction: column;
    gap: 18px;
  }
  .main-fields,
  .subtasks-fields,
  .progress-fields {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .modal-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }
  .main-fields,
  .subtasks-fields,
  .progress-fields {
    width: 100%;
  }
}

/* ================================
   DARK MODE
================================ */
body.dark-mode {
  background: #282a36;
  color: #f8f8f2;
}
body.dark-mode .header-bar,
body.dark-mode .column-header,
body.dark-mode .add-task,
body.dark-mode .add-column,
body.dark-mode .btn-subtask {
  background: #44475a !important;
  color: #f8f8f2 !important;
}
body.dark-mode .list {
  background: #343746;
  color: #f8f8f2;
}
body.dark-mode .task-card {
  background: #282a36;
  color: #f8f8f2;
  border-left-color: #bd93f9;
}
body.dark-mode .modal-content {
  background: #343746;
  color: #f8f8f2;
}
body.dark-mode .progress-bar {
  background: #44475a;
}
body.dark-mode .progress-fill {
  background: #50fa7b;
}
body.dark-mode .btn-save {
  background: #50fa7b;
  color: #282a36;
}
body.dark-mode .btn-save:hover {
  background: #3be87a;
}
body.dark-mode .btn-delete {
  background: #ff5555;
  color: #f8f8f2;
}
body.dark-mode .btn-delete:hover {
  background: #ff2222;
}
body.dark-mode .btn-cancel {
  background: #6272a4;
  color: #f8f8f2;
}
body.dark-mode .btn-cancel:hover {
  background: #44475a;
}
body.dark-mode .subtask-row input[type="text"] {
  background: #282a36;
  color: #f8f8f2;
  border: 1px solid #44475a;
}
body.dark-mode .responsible {
  background: #44475a;
  color: #8be9fd;
}
body.dark-mode .delete-column-btn {
  background: none;
  border: none;
  color: #ff5555;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
  transition: color 0.2s;
}
body.dark-mode .delete-column-btn:hover {
  color: #ff2222;
}

/* ================================
   SCROLLBARS PERSONALIZADOS
================================ */
::-webkit-scrollbar {
  width: 8px;
  background: #23243a;
}
::-webkit-scrollbar-thumb {
  background: #44475a;
  border-radius: 4px;
}

/* ================================
   INPUTS DESHABILITADOS
================================ */
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ================================
   ANIMACION DE APARICION DEL MODAL
================================ */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botones de acción en el modal, con ancho mínimo */
.modal-actions button {
  min-width: 110px;
}

/* Evitar doble scroll cuando el modal está abierto */
body.modal-open {
  overflow: hidden;
}