body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
}

.left-panel {
    flex: 3.5;
    padding: 20px;
    border-right: 1px solid #ccc;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-panel {
    flex: 6.5;
    padding: 20px;
    background-color: #fff;
    position: relative;
}

.recuadros-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.recuadro {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 15px;
    cursor: move;
    user-select: none;
    position: absolute;
    top: 0;
    left: 0;
    color: black;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: aparecerRecuadro 0.3s ease;
}

.papelera {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.papelera img {
    width: 30px;
    height: 30px;
}

#search {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    border-radius: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
}

#item-list {
    list-style-type: none;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: white;
    display: none;
}

#item-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px;
}

.highlighted {
    background-color: #ddd;
    font-weight: bold;
}

.hidden {
    display: none;
}

.compat-section {
    margin-top: 10px;
    display: none;
    flex-direction: column;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background-color: white;
    overflow: hidden;
}

.compat-section h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 10px;
}

#current-trick {
    font-weight: bold;
    color: #333;
    flex-grow: 1;
    margin: 0 10px;
}

button {
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px 10px;
    border-radius: 15px;
    border: none;
    font-size: 12px;
    color: white;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#delete-connection,
#delete-conexion-btn,
#close-info-btn,
#close-help-btn {
    background-color: #ff4444;
}

#delete-connection:hover,
#delete-conexion-btn:hover,
#close-info-btn:hover,
#close-help-btn:hover {
    background-color: #cc0000;
}

#info-trick-btn {
    background-color: #999999;
}

#info-trick-btn:hover {
    background-color: #666666;
}

.transicion-btn {
    background-color: #FF8C00;
}

.transicion-btn:hover {
    background-color: #e67e00;
}

.save-conexion-btn {
    background-color: #4CAF50;
}

.save-conexion-btn:hover {
    background-color: #388E3C;
}

#compat-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    max-height: calc(100% - 50px);
}

#compat-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opaca {
    opacity: 0.5;
    pointer-events: none;
}

.no-compatibles-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    pointer-events: none;
}

svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection-path {
    pointer-events: all;
    cursor: pointer;
    transition: stroke-width 0.2s;
    stroke-width: 2;
    fill: none;
}

.connection-path:hover {
    stroke-width: 4px;
}

.connection-path.transicion {
    stroke: orange;
    stroke-dasharray: 5,5;
}

.connection-path.normal {
    stroke: red;
}

#delete-message {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 5px;
    border-radius: 15px;
    font-size: 12px;
}

.conexion-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    width: 300px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.conexion-menu h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conexion-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conexion-content textarea {
    width: 91%;
    height: 30px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    outline: none;
    resize: none;
}

.conexion-content textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.conexion-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: -5px;
}

.transicion-label {
    position: absolute;
    background-color: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 10px;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: bold;
    pointer-events: all;
    cursor: pointer;
    z-index: 20;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #e65100;
}

.char-counter {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 2px;
}

.char-counter.warning {
    color: #ff4444;
}

.info-modal {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    width: 400px;
    max-width: 80%;
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.info-modal h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.info-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.conexion-menu.compacto {
    height: 55px;
}

.conexion-menu.completo {
    height: 195px;
}

#item-list, .compat-section, .conexion-menu, .info-modal, .help-modal {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#item-list.mostrar, .compat-section.mostrar, .conexion-menu.mostrar, .info-modal.mostrar, .help-modal.mostrar {
    opacity: 1;
    transform: translateY(0);
}

#item-list {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 250px;
}

#item-list.mostrar {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.compat-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.compat-section.mostrar {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

#compat-list li:hover, #item-list li:hover {
    transform: translateX(5px);
    background-color: #f0f0f0;
}

@keyframes aparecerRecuadro {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.papelera:hover {
    transform: scale(1.1);
    background-color: #ff4444;
}

.papelera:hover img {
    filter: brightness(0) invert(1);
}

.espaciador-lista {
    height: 0;
    transition: height 0.3s ease;
}

#help-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #8A2BE2;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

#help-btn:hover {
    background-color: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.help-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    width: 450px;
    max-width: 90%;
    z-index: 1002;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.help-modal.mostrar {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.help-modal h3 {
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
}

.help-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.help-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-text li {
    margin-bottom: 5px;
}

.help-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.help-link-btn {
    background-color: #8A2BE2;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.help-link-btn:hover {
    background-color: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.mostrar {
    display: block;
    opacity: 1;
}

#compat-list li.opaca {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
    background-color: #f8f8f8;
}

#compat-list li.opaca::after {
    content: "✓";
    position: absolute;
    right: 10px;
    color: #4CAF50;
    font-weight: bold;
}

#compat-list li.opaca:hover {
    transform: none;
    background-color: #f8f8f8;
    cursor: not-allowed;
}

#compat-list li:not(.opaca) {
    cursor: pointer;
}

#compat-list li:not(.opaca):hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.categoria-header {
    font-weight: bold;
    background-color: #e8e8e8;
    cursor: default;
    pointer-events: none;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}