/* Reset y estilos base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    color: #1f2d3d;
    background-color: #f8f9fa;
    height: 100%;
    line-height: 1.5;
}

/* Contenedor principal */
.youtrack-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header simplificado */
.youtrack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 24px;
}

.logo i {
    color: #00BFA5;
    margin-right: 8px;
    font-size: 20px;
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #fd79a8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 10px;
}

/* Tabla de incidencias */
.issues-table-container {
    flex: 1;
    overflow: auto;
    background-color: #fff;
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
}

.issues-table th {
    padding: 10px 15px;
    text-align: left;
    color: #6c757d;
    font-weight: 500;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.issues-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.col-narrow {
    width: 40px;
}

.col-id {
    width: 120px;
}

.col-summary {
    min-width: 300px;
}

.issue-row {
    cursor: pointer;
}

.issue-row:hover {
    background-color: #f5f7fa;
}

.issue-row.expanded {
    background-color: #f0f4f8;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn i {
    transition: transform 0.2s ease-in-out;
    font-size: 12px;
    color: #777;
}

.toggle-btn i.expanded,
.issue-row.expanded .toggle-btn i {
    transform: rotate(90deg);
    color: #00BFA5;
}

.star-cell i {
    color: #ced4da;
    cursor: pointer;
}

.star-cell i.fas {
    color: #ffc107;
}

.issue-summary {
    color: #0056b3;
    font-weight: 500;
}

.issue-details {
    padding-top: 8px;
    color: #6c757d;
    display: none;
}

.issue-row.expanded .issue-details {
    display: block;
}

.col-id {
    color: #0056b3;
    font-family: monospace;
}

.col-type {
    white-space: nowrap;
}

/* Estado y tags */
.col-state span {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    background-color: #e9ecef;
}

.tag {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.tag.front {
    background-color: #e1f5fe;
    color: #0277bd;
}

.tag.back {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Colores para Epic, Subtask, Parent */
.issue-type {
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
}

/* Cambia si deseas otros colores */
.issue-type.epic {
    background-color: #ebf0ff !important;
    color: #0052cc !important;
}
.issue-type.subtask {
    background-color: #ffe8e8 !important;
    color: #a60000 !important;
}
.issue-type.parent {
    background-color: #e8ffe8 !important;
    color: #006600 !important;
}

/* Estilos de la jerarquía */
.child-row {
    position: relative;
}

.child-row td.col-summary {
    position: relative;
}

.child-row td.col-summary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 25px;
    height: 100%;
    width: 2px;
    background-color: #cfd7e6;
}

.child-row td.col-summary::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 25px;
    width: 15px;
    height: 2px;
    background-color: #cfd7e6;
}

.child-level-1 td.col-summary {
    padding-left: 50px;
}

.child-level-2 td.col-summary {
    padding-left: 75px;
}

.child-level-3 td.col-summary {
    padding-left: 100px;
}

/* Estilos de estimación */
.estimation {
    color: #666;
    font-size: 13px;
}

.story-points {
    font-weight: 500;
    color: #0747a6;
}

/* Estado de las tareas */
.state {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.state.open {
    background-color: #deebff;
    color: #0747a6;
}
.state.in-progress {
    background-color: #fffae6;
    color: #cc8800;
}
.state.done {
    background-color: #e3fcef;
    color: #006644;
}

/* Descripciones con checks */
.description-content {
    margin: 4px 0;
    /* Quitamos background-color y border-radius */
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 13px;

    /* Un azul algo más claro, ajusta a tu gusto */
    color: #007bff;

    white-space: pre-line;
}
.details-row {
    display: none; /* Oculto por defecto, se mostrará al expandir */
}

.details-row td {
    border-top: none;
    padding: 8px 15px;
}

.details-row.show {
    display: table-row; /* Para que ocupe ancho completo en la tabla */
}

.task-item {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
}
.task-item.checked {
    color: #008000;
}
.task-item.unchecked {
    color: #555;
}
.task-item.bullet {
    color: #333;
}

/* Botón para cargar CSV */
.csv-load-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #00BFA5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.csv-load-btn i {
    margin-right: 8px;
    font-size: 16px;
}

.csv-load-btn:hover {
    background-color: #00A896;
}

/* Indicador de carga */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}
.loading i {
    margin-right: 10px;
    animation: spin 1s infinite linear;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


.expand-collapse-btn {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
  margin: 10px; /* o lo que prefieras */
}

.expand-collapse-btn:hover {
  background-color: #f2f2f2;
}

/* Debug info */
.debug-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 12px;
    color: #666;
}
