/* Reset básico y fuentes */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #5cb85c;
    color: white;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #4cae4c;
}

button.cancel-btn {
    background-color: #aaa;
    margin-left: 0.5rem;
}
button.cancel-btn:hover {
    background-color: #888;
}


main {
    display: flex;
    flex-grow: 1; /* Para que ocupe el espacio restante */
}

aside {
    width: 250px;
    background-color: #e9e9e9;
    padding: 1rem;
    border-right: 1px solid #ccc;
    overflow-y: auto; /* Para scroll si hay muchos proyectos */
}

aside h2 {
    margin-bottom: 1rem;
    color: #555;
}

#project-list {
    list-style: none;
}

#project-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-left 0.2s ease;
    border-left: 5px solid transparent; /* Para indicar selección */
}

#project-list li:hover {
    background-color: #f0f0f0;
}

#project-list li.selected {
    background-color: #e0e0e0;
    font-weight: bold;
    border-left: 5px solid #5cb85c;
}


#project-detail-container {
    flex-grow: 1;
    padding: 1.5rem;
    background-color: #fff;
}

#project-detail-container h2 {
    margin-bottom: 0.5rem;
    color: #333;
}

#project-detail-container p {
    margin-bottom: 0.5rem;
}

.controls {
    margin: 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem; /* Espacio entre controles */
}

.controls label {
    font-weight: bold;
}
.controls select {
    padding: 0.4rem;
}


#no-project-selected {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: #777;
}

.hidden {
    display: none !important; /* !important para sobreescribir otras reglas */
}

/* Estilos Vistas */
.view {
    margin-top: 1rem;
}

/* --- Columna Enfocada --- */
#column-view h3 {
    margin-bottom: 0.8rem;
    color: #555;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 0.3rem;
}

#column-view ul {
    list-style: none;
    padding-left: 0;
}

#column-view li {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}
#column-view li.completed {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: #e0ffe0;
}
#column-view li.blocked {
     border-left: 5px solid orange;
}
#column-view li:hover {
    background-color: #f0f0f0;
}

#column-view .priority-icon {
    font-weight: bold;
    margin-right: 0.5rem;
    min-width: 20px;
}
#column-view .priority-3 { color: red; }
#column-view .priority-2 { color: orange; }
#column-view .priority-1 { color: green; }

#column-view .task-name {
    flex-grow: 1;
    margin-right: 1rem;
}
#column-view .task-estimation {
    font-size: 0.8em;
    background-color: #ddd;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
}

#column-view .task-actions button {
    margin-left: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}
#column-view .milestone-separator {
    font-weight: bold;
    color: #007bff;
    margin: 1rem 0 0.5rem 0;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}
#column-view .milestone-separator::before,
#column-view .milestone-separator::after {
    content: " ⭐ ";
}


/* --- Camino Visual (Roadmap) --- */
#roadmap-view {
    position: relative;
    padding: 2rem 0;
    min-height: 150px; /* Asegura espacio para la línea */
}
#roadmap-view::before { /* La línea principal del camino */
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #ccc;
    transform: translateY(-50%);
    z-index: 1;
}

#roadmap-view .milestone-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background-color: #007bff;
    border-radius: 50%;
    border: 3px solid white;
    z-index: 3; /* Encima de la línea y tareas */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
}
#roadmap-view .milestone-marker.completed {
     background-color: #5cb85c; /* Verde al completar */
}

#roadmap-view .milestone-label {
    position: absolute;
    top: calc(50% + 20px); /* Debajo del marcador */
    transform: translateX(-50%);
    font-size: 0.8rem;
    text-align: center;
    width: 100px; /* Ancho para evitar solapamientos */
    color: #555;
    z-index: 2;
}
#roadmap-view .milestone-label.completed {
    text-decoration: line-through;
    opacity: 0.7;
}

#roadmap-view .roadmap-objective {
    position: absolute;
    top: 50%;
    right: -10px; /* Ligeramente fuera */
    transform: translateY(-50%);
    font-size: 1.5rem; /* Icono grande */
    z-index: 2;
}

#roadmap-view .task-group {
    position: absolute;
    top: calc(50% - 50px); /* Encima de la línea */
    transform: translateX(-50%);
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 4px;
    z-index: 2;
    text-align: center;
}
#roadmap-view .task-group strong { display: block; margin-bottom: 0.3rem; }
#roadmap-view .task-group ul { list-style: none; padding: 0; margin: 0; }
#roadmap-view .task-group li { margin-bottom: 0.2rem; }
#roadmap-view .task-group li.completed { text-decoration: line-through; opacity: 0.6;}


/* --- Vista Iconografía --- */
#icon-view h3 {
    margin-bottom: 0.8rem;
    color: #555;
}
#icon-view .milestones-list { margin-bottom: 1rem; }
#icon-view .milestones-list span {
    display: inline-block;
    margin-right: 1rem;
    background: #eee;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}
#icon-view .milestones-list span.completed { text-decoration: line-through; opacity: 0.7; }

#icon-view ul { list-style: none; padding: 0; }
#icon-view li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}
#icon-view li.completed { text-decoration: line-through; opacity: 0.6; }
#icon-view li.blocked { color: orange; }

#icon-view .task-icons {
    min-width: 60px; /* Espacio para iconos */
    display: flex;
    gap: 0.3rem;
}
#icon-view .icon-priority { font-weight: bold; }
#icon-view .icon-priority-3 { color: red; }
#icon-view .icon-priority-2 { color: orange; }
#icon-view .icon-priority-1 { color: green; }
#icon-view .icon-milestone { color: #007bff; } /* Icono de Hito asociado */
#icon-view .icon-estimation {
    font-size: 0.8em;
    background-color: #ddd;
    padding: 0 0.3rem;
    border-radius: 3px;
}
#icon-view .icon-blocked { color: red; font-weight: bold;}

#icon-view .task-name {
    flex-grow: 1;
    margin: 0 1rem;
}

#icon-view .task-actions button {
    margin-left: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}


/* Progreso */
#progress-container {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
#project-progress {
    width: 80%;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}
#progress-percentage {
    font-weight: bold;
    vertical-align: middle;
}

/* Modales */
#modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 11;
    min-width: 350px;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #333;
}

.modal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.modal input[type="text"],
.modal select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal button {
    margin-top: 1rem;
    min-width: 100px;
}