/**
 * nmsapp
 * Estilos para los formularios y shortcodes
 * Version: 1.0.1
 */

/* --- Carga de la Fuente de Glifos --- */
@font-face {
    font-family: 'NMS-Glyphs-Mono';
    src: url('NMS-Glyphs-Mono.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* --- Estilos del Formulario --- */
.nmsd-form-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* --- NUEVO: Pantalla de Selección --- */
.nmsd-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.nmsd-selection-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: #333;
    line-height: 1.4;
}

.nmsd-selection-btn:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* --- NUEVO: Botón de Volver --- */
.nmsd-back-btn {
    background: none;
    border: none;
    color: #0073aa; /* Color de enlace estándar de WP */
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0 1rem 0;
    display: inline-block;
    margin-bottom: 1rem;
}

.nmsd-back-btn:hover {
    text-decoration: underline;
}

.nmsd-specific-form h3 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}


/* --- Grupos de Formulario --- */
.nmsd-form-group {
    margin-bottom: 1.5rem;
}

.nmsd-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.nmsd-form-group input[type="text"],
.nmsd-form-group textarea,
.nmsd-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Importante para que el padding no rompa el ancho */
}

.nmsd-form-group input[type="file"] {
    padding: 0.5rem;
}

.nmsd-form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #777;
    font-style: italic;
}

.nmsd-required {
    color: red;
    margin-left: 2px;
}

.nmsd-form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nmsd-form-checkbox input[type="checkbox"] {
    width: auto;
}

.nmsd-form-checkbox label {
    margin-bottom: 0;
    font-weight: normal;
}

p.description {
    font-size: 0.9rem;
    color: #666;
    margin-top: -0.5rem;
}

.nmsd-form-submit input[type="submit"] {
    background-color: #0073aa;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nmsd-form-submit input[type="submit"]:hover {
    background-color: #005a87;
}

/* --- Alertas --- */
.nmsd-alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border: 1px solid;
}
.nmsd-alert-success {
    background-color: #f7fff7;
    border-color: #c3e6cb;
    color: #155724;
}
.nmsd-alert-error {
    background-color: #fff7f7;
    border-color: #f5c6cb;
    color: #721c24;
}

/* --- Estilos de la Interfaz de Glifos --- */
.glyph-palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 1rem;
    touch-action: none; /* Para el drag-drop táctil */
}

.glyph-item {
    font-family: 'NMS-Glyphs-Mono', monospace;
    font-size: 2.5rem;
    text-align: center;
    cursor: grab;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #ddd;
    line-height: 1.2;
    padding: 5px 0;
    user-select: none;
    -webkit-user-select: none;
}
.glyph-item:hover {
    background: #f0f0f0;
}
.glyph-item.dragging {
    opacity: 0.5;
}

.glyph-sequence-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
    background: #fff;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-height: 70px;
}

.glyph-sequence-box {
    position: relative;
    border: 2px dashed #d9d9d9;
    border-radius: 4px;
    min-height: 60px;
    transition: background-color 0.2s ease;
}
.glyph-sequence-box.drag-over {
    background-color: #e6f7ff;
    border-color: #0073aa;
}

.glyph-item-in-box {
    font-family: 'NMS-Glyphs-Mono', monospace;
    font-size: 2.5rem;
    text-align: center;
    line-height: 1.2;
    padding: 5px 0;
    pointer-events: none; /* No interferir con el drop */
}

.delete-glyph-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.delete-glyph-btn:hover {
    opacity: 1;
}

.clear-glyphs-btn {
    background: #f5f5f5;
    border: 1px solid #ccc;
    color: #555;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}
.clear-glyphs-btn:hover {
    background: #e9e9e9;
}

/* Clon fantasma para arrastre táctil */
.touch-dragging {
    position: fixed; /* O 'absolute' si 'rootEl' es el contenedor */
    opacity: 0.8;
    background: #f0f0f0;
    border: 1px solid #999;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Estilos del Dashboard [nms_my_discoveries] --- */
.nmsd-my-discoveries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nmsd-my-discovery-item {
    display: flex;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 8px;
    align-items: center;
}

.nmsd-my-discovery-thumb {
    flex-shrink: 0;
}
.nmsd-my-discovery-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.nmsd-my-discovery-content h3 {
    margin: 0 0 0.25rem 0;
}
.nmsd-my-discovery-content h3 a {
    text-decoration: none;
    color: #1d2327;
}
.nmsd-my-discovery-content h3 a:hover {
    text-decoration: underline;
}

.nmsd-my-discovery-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.nmsd-my-discovery-terms .term {
    display: inline-block;
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.nmsd-button {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.nmsd-button:hover {
    background-color: #005a87;
    color: white;
}

