/* novas-tm-parser.css */

/* ── Loading Overlay ──────────────────────────────────────────── */
#ntm-loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    gap: 16px;
}

.ntm-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ntm-spin 0.8s linear infinite;
}

@keyframes ntm-spin { to { transform: rotate(360deg); } }

/* ── Modal Overlay ────────────────────────────────────────────── */
#ntm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px;
    overflow-y: auto;
}

#ntm-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────── */
#ntm-modal-header {
    background: #0a3d62;
    color: #fff;
    padding: 20px 24px;
    position: relative;
    flex-shrink: 0;
}

#ntm-modal-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #fff;
}

#ntm-modal-header p {
    margin: 0;
    opacity: 0.8;
    font-size: 13px;
}

#ntm-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ntm-close:hover { background: rgba(255,255,255,0.4); }

/* ── Body ─────────────────────────────────────────────────────── */
#ntm-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ntm-section {
    margin-bottom: 32px;
}

.ntm-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0a3d62;
    border-bottom: 2px solid #e8f0fe;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.ntm-hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

/* ── Core field rows ──────────────────────────────────────────── */
.ntm-field-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    margin-bottom: 12px;
    align-items: start;
}

.ntm-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    padding-top: 8px;
}

.ntm-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border 0.2s;
}

.ntm-input:focus {
    outline: none;
    border-color: #0a3d62;
    box-shadow: 0 0 0 3px rgba(10,61,98,0.12);
}

/* ── Module rows ──────────────────────────────────────────────── */
.ntm-module-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    margin-bottom: 10px;
    align-items: start;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e4e8f7;
}

.ntm-module-num {
    font-size: 11px;
    font-weight: 700;
    color: #0a3d62;
    background: #e8f0fe;
    border-radius: 4px;
    text-align: center;
    padding: 4px 2px;
    align-self: start;
    margin-top: 6px;
}

.ntm-module-fields {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-rows: auto auto;
    gap: 6px;
}

.ntm-mod-name {
    grid-column: 1;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}

.ntm-mod-time {
    grid-column: 2;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}

.ntm-mod-desc {
    grid-column: 1 / -1;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.ntm-mod-name:focus,
.ntm-mod-time:focus,
.ntm-mod-desc:focus {
    outline: none;
    border-color: #0a3d62;
    box-shadow: 0 0 0 2px rgba(10,61,98,0.1);
}

/* ── Footer ───────────────────────────────────────────────────── */
#ntm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}

#ntm-cancel {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

#ntm-cancel:hover { background: #f5f5f5; }

#ntm-confirm {
    padding: 10px 24px;
    background: #0a3d62;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

#ntm-confirm:hover { background: #0c4f7e; }

@media (max-width: 600px) {
    .ntm-field-row { grid-template-columns: 1fr; }
    .ntm-module-fields { grid-template-columns: 1fr; }
    .ntm-mod-time { grid-column: 1; }
}
