/* styles.css */

/* ------------------ RESETEO BÁSICO Y ESTRUCTURA ------------------ */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ------------------ BARRA SUPERIOR ------------------ */
.top-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    position: relative;
}
.btn {
    cursor: pointer;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 5px;
    font-size: 0.7rem;
}
.btn:hover {
    background: #f0f0f0;
}
.kpi-indicator {
    font-weight: bold;
    margin-left: 10px;
    margin-right: 10px;
}
#points-display {
    font-weight: bold;
    margin-left: auto;
}
#user-info {
    margin-left: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}
#menu-dropdown {
    position: absolute;
    top: 50px;
    right: 10px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 9999;
    display: none;
}
#menu-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
#menu-dropdown li {
    cursor: pointer;
    padding: 5px;
}
#menu-dropdown li:hover {
    background: #f0f0f0;
}

/* ------------------ CUADRANTES ------------------ */
.quadrants-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    flex: 1;
    box-sizing: border-box;
    overflow: auto;
}
.cell {
    flex: 1 1 calc(50% - 20px);
    min-height: 200px;
    position: relative;
    border-radius: 8px;
    padding-top: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
    background: #fafafa;
}
.cell-title {
    position: absolute;
    top: 0; left: 0; right: 0;
    text-align: center;
    font-weight: bold;
    padding: 5px;
    background: #444;
    color: #fff;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-sizing: border-box;
}
/* Colores de cada cuadrante */
.cell[data-category="UI"]   { background: #fffae6; }
.cell[data-category="UNI"]  { background: #e6fff9; }
.cell[data-category="NUI"]  { background: #e6f9ff; }
.cell[data-category="NUNI"] { background: #ffe6e6; }

/* ------------------ TAREAS ------------------ */
.task {
    background: #fff;
    margin: 5px;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    cursor: grab;
}
.task.completed {
    text-decoration: line-through;
    color: #888;
}
.task[data-carriedover="true"] {
    border: 2px solid red;
}
.task-icons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}
.task:hover .task-icons,
.task:focus-within .task-icons {
    visibility: visible;
    opacity: 1;
}
.task-placeholder {
    border: 2px dashed #999;
    height: 40px;
    margin: 10px;
}

/* ------------------ MODALES FLOTANTES ------------------ */
.floating-input {
    position: fixed; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 10px;
    display: none;
    z-index: 2000;
    flex-direction: row;
    gap: 5px;
}
.floating-input input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
}

/* ------------------ MODALES DE ADVERTENCIA, PERFIL, ETC. ------------------ */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}
.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-sizing: border-box;
}

/* ------------------ MENÚ CONTEXTUAL ------------------ */
#task-context-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: none;
    z-index: 3000;
    min-width: 130px;
}
#task-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 5px;
}
#task-context-menu li {
    padding: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}
#task-context-menu li:hover {
    background: #f0f0f0;
}

/* ------------------ TOASTS ------------------ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
}
.toast {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@keyframes fadein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeout {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ------------------ RESPONSIVE ------------------ */
@media(max-width:600px){
  .top-bar {
    flex-wrap: wrap;
    padding: 5px;
  }
  .top-bar .btn {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
  #points-display {
    font-size: 0.8rem;
  }
  .kpi-indicator {
    font-size: 0.8rem;
    margin: 0 5px;
  }
  #user-info {
    font-size: 0.8rem;
  }
  .cell {
    flex:1 1 100%;
    min-height:160px;
  }
  .cell-title {
    font-size: 1rem;
    padding: 3px;
  }
  .task {
    padding: 8px;
  }
  .task-text {
    font-size: 0.9rem;
  }
}
